Java Doc for JMLObjectBag.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.JMLObjectBag

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


Field Summary
final public static  JMLObjectBagEMPTY
     The empty JMLObjectBag.
final protected  intsize
     The size of this bag.
final protected  JMLObjectBagEntryNodethe_list
     The list representing the contents of this bag.

Constructor Summary
public  JMLObjectBag()
     Initialize this bag to be empty.
public  JMLObjectBag(Object elem)
     Initialize this bag to contain the given element.
protected  JMLObjectBag(JMLObjectBagEntryNode 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 "==" element in this bag.
public static  JMLObjectBagconvertFrom(Object[] a)
     Return the bag containing all the elements in the given array.
public static  JMLObjectBagconvertFrom(java.util.Collection c)
     Return the bag containing all the object in the given collection.
public static  JMLObjectBagconvertFrom(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 "==" to an element in this bag.
Parameters:
  elem - the element sought.
public  JMLObjectBagdifference(JMLObjectBag b2)
     Return a bag containing the items in this bag minus the items in the given bag.
public  JMLObjectBagEnumeratorelements()
     Returns an Enumeration over this bag.
public  booleanequals(Object b2)
     Test whether this object's value is equal to the given argument.
protected  JMLObjectBagEntrygetMatchingEntry(Object item)
     Find a JMLObjectBagEntry that is for the same element, if possible.
Parameters:
  item - the item sought.
public  booleanhas(Object elem)
     Tell whether the given element occurs "==" to an element in this bag.
public  inthashCode()
    
public  JMLObjectBaginsert(Object elem)
     Return a bag containing the given item and the ones in this bag.
public  JMLObjectBaginsert(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  JMLObjectBagintersection(JMLObjectBag 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(JMLObjectBag b2)
     Tells whether every item in this bag is contained in the argument, but the argument is strictly larger.
public  booleanisProperSuperbag(JMLObjectBag b2)
     Tells whether every item in the argument is contained in this bag argument, but this bag is strictly larger.
public  booleanisSubbag(JMLObjectBag b2)
     Tells whether every item in this bag is contained in the argument.
public  booleanisSuperbag(JMLObjectBag b2)
     Tells whether every item in the argument is contained in this bag.
public  JMLIteratoriterator()
     Returns an iterator over this bag.
public  JMLObjectBagremove(Object elem)
     Return a bag containing the items in this bag except for one of the given element.
public  JMLObjectBagremove(Object elem, int cnt)
     Return a bag containing the items in this bag, except for the given number of the given element.
public  JMLObjectBagremoveAll(Object elem)
     Return a bag containing the items in this bag, except for all items that are "==" to the given item.
public static  JMLObjectBagsingleton(Object e)
     Return the singleton bag containing the given element.
public  Object[]toArray()
     Return a new array containing all the elements of this.
public  JMLObjectSequencetoSequence()
     Return a new JMLObjectSequence containing all the elements of this.
public  JMLObjectSettoSet()
     Return a new JMLObjectSet containing all the elements of this.
public  StringtoString()
     Return a string representation of this object.
public  JMLObjectBagunion(JMLObjectBag b2)
     Return a bag containing the items in either this bag or the given bag.

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



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



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




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



JMLObjectBag
public JMLObjectBag(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:   JMLObjectBag.singleton



JMLObjectBag
protected JMLObjectBag(JMLObjectBagEntryNode 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:   JMLObjectBag.isEmpty()
See Also:   JMLObjectBag.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 "==" element in this bag.
Parameters:
  c - the collection whose elements are sought.
See Also:   JMLObjectBag.isSuperbag(JMLObjectSet)
See Also:   JMLObjectBag.convertFrom(java.util.Collection)



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



convertFrom
public static JMLObjectBag 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:   JMLObjectBag.containsAll(java.util.Collection)



convertFrom
public static JMLObjectBag 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 "==" to an element in this bag.
Parameters:
  elem - the element sought. the number of times elem occurs in this bag.
See Also:   JMLObjectBag.has(Object)



difference
public JMLObjectBag difference(JMLObjectBag 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:   JMLObjectBag.union(JMLObjectBag)
See Also:   JMLObjectBag.difference(JMLObjectBag)



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



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

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




getMatchingEntry
protected JMLObjectBagEntry getMatchingEntry(Object item)(Code)
Find a JMLObjectBagEntry 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 "==" to an element in this bag.
Parameters:
  elem - the element sought.
See Also:   JMLObjectBag.count(Object)



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



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



insert
public JMLObjectBag 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:   JMLObjectBag.insert(Object)
See Also:   JMLObjectBag.has(Object)
See Also:   JMLObjectBag.remove(Object,int)



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



intersection
public JMLObjectBag intersection(JMLObjectBag 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:   JMLObjectBag.union(JMLObjectBag)
See Also:   JMLObjectBag.difference(JMLObjectBag)



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



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



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



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



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



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



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



remove
public JMLObjectBag 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:   JMLObjectBag.remove(Object)
See Also:   JMLObjectBag.insert(Object,int)



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



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



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



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



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



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



union
public JMLObjectBag union(JMLObjectBag 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:   JMLObjectBag.intersection(JMLObjectBag)
See Also:   JMLObjectBag.difference(JMLObjectBag)



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.