Java Doc for JMLEqualsBag.java in  » Testing » KeY » org » jmlspecs » models » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Testing » KeY » org.jmlspecs.models 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.jmlspecs.models.JMLEqualsBag

JMLEqualsBag
public class JMLEqualsBag implements JMLCollection(Code)
Bags (i.e., multisets) of objects. This type uses ".equals" to compare elements, and does not clone elements that are passed into and returned from the bag's methods.
version:
   $Revision: 1.4 $
author:
   Gary T. Leavens, with help from Albert Baker, Clyde Ruby,
author:
   and others.
See Also:   JMLCollection
See Also:   JMLType
See Also:   JMLObjectBag
See Also:   JMLValueBag
See Also:   JMLEqualsBagEnumerator
See Also:   JMLObjectSet
See Also:   JMLValueSet


Field Summary
final public static  JMLEqualsBagEMPTY
     The empty JMLEqualsBag.
final protected  intsize
     The size of this bag.
final protected  JMLEqualsBagEntryNodethe_list
     The list representing the contents of this bag.

Constructor Summary
public  JMLEqualsBag()
     Initialize this bag to be empty.
public  JMLEqualsBag(Object elem)
     Initialize this bag to contain the given element.
protected  JMLEqualsBag(JMLEqualsBagEntryNode ls, int sz)
     Initialize this bag with the given representation.

Method Summary
public  Objectchoose()
     Return an arbitrary element of this.
public  Objectclone()
     Return a clone of this object.
public  booleancontainsAll(java.util.Collection c)
     Tell whether, for each element in the given collection, there is a ".equals" element in this bag.
public static  JMLEqualsBagconvertFrom(Object[] a)
     Return the bag containing all the elements in the given array.
public static  JMLEqualsBagconvertFrom(java.util.Collection c)
     Return the bag containing all the object in the given collection.
public static  JMLEqualsBagconvertFrom(JMLCollection c)
     Return the bag containing all the object in the given JMLCollection.
public  intcount(Object elem)
     Tell how many times the given element occurs ".equals" to an element in this bag.
Parameters:
  elem - the element sought.
public  JMLEqualsBagdifference(JMLEqualsBag b2)
     Return a bag containing the items in this bag minus the items in the given bag.
public  JMLEqualsBagEnumeratorelements()
     Returns an Enumeration over this bag.
public  booleanequals(Object b2)
     Test whether this object's value is equal to the given argument.
protected  JMLEqualsBagEntrygetMatchingEntry(Object item)
     Find a JMLEqualsBagEntry that is for the same element, if possible.
Parameters:
  item - the item sought.
public  booleanhas(Object elem)
     Tell whether the given element occurs ".equals" to an element in this bag.
public  inthashCode()
    
public  JMLEqualsBaginsert(Object elem)
     Return a bag containing the given item and the ones in this bag.
public  JMLEqualsBaginsert(Object elem, int cnt)
     Return a bag containing the given item the given number of times, in addition to the ones in this bag.
public  intint_size()
     Tell the number of elements in this bag.
public  JMLEqualsBagintersection(JMLEqualsBag b2)
     Return a bag containing the items in both this bag and the given bag.
public  booleanisEmpty()
     Tell whether this bag has no elements.
public  booleanisProperSubbag(JMLEqualsBag b2)
     Tells whether every item in this bag is contained in the argument, but the argument is strictly larger.
public  booleanisProperSuperbag(JMLEqualsBag b2)
     Tells whether every item in the argument is contained in this bag argument, but this bag is strictly larger.
public  booleanisSubbag(JMLEqualsBag b2)
     Tells whether every item in this bag is contained in the argument.
public  booleanisSuperbag(JMLEqualsBag b2)
     Tells whether every item in the argument is contained in this bag.
public  JMLIteratoriterator()
     Returns an iterator over this bag.
public  JMLEqualsBagremove(Object elem)
     Return a bag containing the items in this bag except for one of the given element.
public  JMLEqualsBagremove(Object elem, int cnt)
     Return a bag containing the items in this bag, except for the given number of the given element.
public  JMLEqualsBagremoveAll(Object elem)
     Return a bag containing the items in this bag, except for all items that are ".equals" to the given item.
public static  JMLEqualsBagsingleton(Object e)
     Return the singleton bag containing the given element.
public  Object[]toArray()
     Return a new array containing all the elements of this.
public  JMLEqualsSequencetoSequence()
     Return a new JMLEqualsSequence containing all the elements of this.
public  JMLEqualsSettoSet()
     Return a new JMLEqualsSet containing all the elements of this.
public  StringtoString()
     Return a string representation of this object.
public  JMLEqualsBagunion(JMLEqualsBag b2)
     Return a bag containing the items in either this bag or the given bag.

Field Detail
EMPTY
final public static JMLEqualsBag EMPTY(Code)
The empty JMLEqualsBag.
See Also:   JMLEqualsBag.JMLEqualsBag()



size
final protected int size(Code)
The size of this bag.



the_list
final protected JMLEqualsBagEntryNode the_list(Code)
The list representing the contents of this bag. Each element of this list is of type JMLEqualsBagEntry.




Constructor Detail
JMLEqualsBag
public JMLEqualsBag()(Code)
Initialize this bag to be empty.
See Also:   JMLEqualsBag.EMPTY



JMLEqualsBag
public JMLEqualsBag(Object elem)(Code)
Initialize this bag to contain the given element.
Parameters:
  elem - the element that is the sole contents of this bag.
See Also:   JMLEqualsBag.singleton



JMLEqualsBag
protected JMLEqualsBag(JMLEqualsBagEntryNode ls, int sz)(Code)
Initialize this bag with the given representation.




Method Detail
choose
public Object choose() throws JMLNoSuchElementException(Code)
Return an arbitrary element of this.
exception:
  JMLNoSuchElementException - if this is empty.
See Also:   JMLEqualsBag.isEmpty()
See Also:   JMLEqualsBag.elements()



clone
public Object clone()(Code)
Return a clone of this object. This method does not clone the elements of the bag.



containsAll
public boolean containsAll(java.util.Collection c)(Code)
Tell whether, for each element in the given collection, there is a ".equals" element in this bag.
Parameters:
  c - the collection whose elements are sought.
See Also:   JMLEqualsBag.isSuperbag(JMLEqualsSet)
See Also:   JMLEqualsBag.convertFrom(java.util.Collection)



convertFrom
public static JMLEqualsBag convertFrom(Object[] a)(Code)
Return the bag containing all the elements in the given array.



convertFrom
public static JMLEqualsBag convertFrom(java.util.Collection c) throws ClassCastException(Code)
Return the bag containing all the object in the given collection.
throws:
  ClassCastException - if some element in c is not an instance of Object.
See Also:   JMLEqualsBag.containsAll(java.util.Collection)



convertFrom
public static JMLEqualsBag convertFrom(JMLCollection c) throws ClassCastException(Code)
Return the bag containing all the object in the given JMLCollection.
throws:
  ClassCastException - if some element in c is not an instance of Object.



count
public int count(Object elem)(Code)
Tell how many times the given element occurs ".equals" to an element in this bag.
Parameters:
  elem - the element sought. the number of times elem occurs in this bag.
See Also:   JMLEqualsBag.has(Object)



difference
public JMLEqualsBag difference(JMLEqualsBag b2)(Code)
Return a bag containing the items in this bag minus the items in the given bag. If an item occurs in this bag N times, and M times in the given bag, then it occurs N-M times in the result.
See Also:   JMLEqualsBag.union(JMLEqualsBag)
See Also:   JMLEqualsBag.difference(JMLEqualsBag)



elements
public JMLEqualsBagEnumerator elements()(Code)
Returns an Enumeration over this bag.
See Also:   JMLEqualsBag.iterator()



equals
public boolean equals(Object b2)(Code)
Test whether this object's value is equal to the given argument. This comparison uses ".equals" to compare elements.

Note that the elementTypes may be different for otherwise equal bags.




getMatchingEntry
protected JMLEqualsBagEntry getMatchingEntry(Object item)(Code)
Find a JMLEqualsBagEntry that is for the same element, if possible.
Parameters:
  item - the item sought. null if the item is not in the bag.



has
public boolean has(Object elem)(Code)
Tell whether the given element occurs ".equals" to an element in this bag.
Parameters:
  elem - the element sought.
See Also:   JMLEqualsBag.count(Object)



hashCode
public int hashCode()(Code)
Return a hash code for this object



insert
public JMLEqualsBag insert(Object elem) throws IllegalStateException(Code)
Return a bag containing the given item and the ones in this bag.
See Also:   JMLEqualsBag.insert(Object,int)
See Also:   JMLEqualsBag.has(Object)
See Also:   JMLEqualsBag.remove(Object)



insert
public JMLEqualsBag insert(Object elem, int cnt) throws IllegalArgumentException, IllegalStateException(Code)
Return a bag containing the given item the given number of times, in addition to the ones in this bag.
See Also:   JMLEqualsBag.insert(Object)
See Also:   JMLEqualsBag.has(Object)
See Also:   JMLEqualsBag.remove(Object,int)



int_size
public int int_size()(Code)
Tell the number of elements in this bag.



intersection
public JMLEqualsBag intersection(JMLEqualsBag b2)(Code)
Return a bag containing the items in both this bag and the given bag. Note that items occur the minimum number of times they occur in both bags.
See Also:   JMLEqualsBag.union(JMLEqualsBag)
See Also:   JMLEqualsBag.difference(JMLEqualsBag)



isEmpty
public boolean isEmpty()(Code)
Tell whether this bag has no elements.
See Also:   JMLEqualsBag.int_size()
See Also:   JMLEqualsBag.has(Object)



isProperSubbag
public boolean isProperSubbag(JMLEqualsBag b2)(Code)
Tells whether every item in this bag is contained in the argument, but the argument is strictly larger.
See Also:   JMLEqualsBag.isSubbag(JMLEqualsBag)
See Also:   JMLEqualsBag.isProperSuperbag(JMLEqualsBag)



isProperSuperbag
public boolean isProperSuperbag(JMLEqualsBag b2)(Code)
Tells whether every item in the argument is contained in this bag argument, but this bag is strictly larger.
See Also:   JMLEqualsBag.isSuperbag(JMLEqualsBag)
See Also:   JMLEqualsBag.isProperSubbag(JMLEqualsBag)



isSubbag
public boolean isSubbag(JMLEqualsBag b2)(Code)
Tells whether every item in this bag is contained in the argument.
See Also:   JMLEqualsBag.isProperSubbag(JMLEqualsBag)
See Also:   JMLEqualsBag.isSuperbag(JMLEqualsBag)



isSuperbag
public boolean isSuperbag(JMLEqualsBag b2)(Code)
Tells whether every item in the argument is contained in this bag.
See Also:   JMLEqualsBag.isProperSuperbag(JMLEqualsBag)
See Also:   JMLEqualsBag.isSubbag(JMLEqualsBag)
See Also:   JMLEqualsBag.containsAll(java.util.Collection)



iterator
public JMLIterator iterator()(Code)
Returns an iterator over this bag.
See Also:   JMLEqualsBag.elements()



remove
public JMLEqualsBag remove(Object elem)(Code)
Return a bag containing the items in this bag except for one of the given element.
See Also:   JMLEqualsBag.remove(Object,int)
See Also:   JMLEqualsBag.insert(Object)



remove
public JMLEqualsBag remove(Object elem, int cnt) throws IllegalArgumentException(Code)
Return a bag containing the items in this bag, except for the given number of the given element.
See Also:   JMLEqualsBag.remove(Object)
See Also:   JMLEqualsBag.insert(Object,int)



removeAll
public JMLEqualsBag removeAll(Object elem)(Code)
Return a bag containing the items in this bag, except for all items that are ".equals" to the given item.
See Also:   JMLEqualsBag.remove(Object)
See Also:   JMLEqualsBag.remove(Object,int)



singleton
public static JMLEqualsBag singleton(Object e)(Code)
Return the singleton bag containing the given element.
See Also:   JMLEqualsBag.JMLEqualsBag(Object)



toArray
public Object[] toArray()(Code)
Return a new array containing all the elements of this.
See Also:   JMLEqualsBag.toSequence()



toSequence
public JMLEqualsSequence toSequence()(Code)
Return a new JMLEqualsSequence containing all the elements of this.
See Also:   JMLEqualsBag.toArray()
See Also:   JMLEqualsBag.toSet()



toSet
public JMLEqualsSet toSet()(Code)
Return a new JMLEqualsSet containing all the elements of this.
See Also:   JMLEqualsBag.toSequence()



toString
public String toString()(Code)
Return a string representation of this object.



union
public JMLEqualsBag union(JMLEqualsBag b2)(Code)
Return a bag containing the items in either this bag or the given bag. Note that items occur the sum of times they occur in both bags.
See Also:   JMLEqualsBag.intersection(JMLEqualsBag)
See Also:   JMLEqualsBag.difference(JMLEqualsBag)



Methods inherited from java.lang.Object
protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object o)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
final public void notify() throws IllegalMonitorStateException(Code)(Java Doc)
final public void notifyAll() throws IllegalMonitorStateException(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final public void wait() throws IllegalMonitorStateException, InterruptedException(Code)(Java Doc)
final public void wait(long ms) throws IllegalMonitorStateException, InterruptedException(Code)(Java Doc)
final public void wait(long ms, int ns) throws IllegalMonitorStateException, InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.