Java Doc for JMLValueBag.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.JMLValueBagSpecs
      org.jmlspecs.models.JMLValueBag

JMLValueBag
public class JMLValueBag extends JMLValueBagSpecs implements JMLCollection(Code)
Bags (i.e., multisets) of values. This type uses ".equals" to compare elements, and clones elements that are passed into and returned from the bag's methods.
version:
   $Revision: 1.2 $
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:   JMLValueBagEnumerator
See Also:   JMLValueBagSpecs
See Also:   JMLObjectSet
See Also:   JMLValueSet


Field Summary
final public static  JMLValueBagEMPTY
     The empty JMLValueBag.
final protected  intsize
     The size of this bag.
final protected  JMLValueBagEntryNodethe_list
     The list representing the contents of this bag.

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

Method Summary
public  JMLTypechoose()
     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  JMLValueBagconvertFrom(JMLType[] a)
     Return the bag containing all the elements in the given array.
public static  JMLValueBagconvertFrom(java.util.Collection c)
     Return the bag containing all the value in the given collection.
public static  JMLValueBagconvertFrom(JMLCollection c)
     Return the bag containing all the value in the given JMLCollection.
public  intcount(JMLType elem)
     Tell how many times the given element occurs ".equals" to an element in this bag.
Parameters:
  elem - the element sought.
public  JMLValueBagdifference(JMLValueBag b2)
     Return a bag containing the items in this bag minus the items in the given bag.
public  JMLValueBagEnumeratorelements()
     Returns an Enumeration over this bag.
public  booleanequals(Object b2)
     Test whether this object's value is equal to the given argument.
protected  JMLValueBagEntrygetMatchingEntry(JMLType item)
     Find a JMLValueBagEntry that is for the same element, if possible.
Parameters:
  item - the item sought.
public  booleanhas(JMLType elem)
     Tell whether the given element occurs ".equals" to an element in this bag.
public  inthashCode()
    
public  JMLValueBaginsert(JMLType elem)
     Return a bag containing the given item and the ones in this bag.
public  JMLValueBaginsert(JMLType 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  JMLValueBagintersection(JMLValueBag 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(JMLValueBag b2)
     Tells whether every item in this bag is contained in the argument, but the argument is strictly larger.
public  booleanisProperSuperbag(JMLValueBag b2)
     Tells whether every item in the argument is contained in this bag argument, but this bag is strictly larger.
public  booleanisSubbag(JMLValueBag b2)
     Tells whether every item in this bag is contained in the argument.
public  booleanisSuperbag(JMLValueBag b2)
     Tells whether every item in the argument is contained in this bag.
public  JMLIteratoriterator()
     Returns an iterator over this bag.
public  JMLValueBagremove(JMLType elem)
     Return a bag containing the items in this bag except for one of the given element.
public  JMLValueBagremove(JMLType elem, int cnt)
     Return a bag containing the items in this bag, except for the given number of the given element.
public  JMLValueBagremoveAll(JMLType elem)
     Return a bag containing the items in this bag, except for all items that are ".equals" to the given item.
public static  JMLValueBagsingleton(JMLType e)
     Return the singleton bag containing the given element.
public  JMLType[]toArray()
     Return a new array containing all the elements of this.
public  JMLValueSequencetoSequence()
     Return a new JMLValueSequence containing all the elements of this.
public  JMLValueSettoSet()
     Return a new JMLValueSet containing all the elements of this.
public  StringtoString()
     Return a string representation of this object.
public  JMLValueBagunion(JMLValueBag b2)
     Return a bag containing the items in either this bag or the given bag.

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



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



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




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



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



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




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



clone
public Object clone()(Code)
Return a clone of this object. This method clones 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:   JMLValueBag.isSuperbag(JMLValueSet)
See Also:   JMLValueBag.convertFrom(java.util.Collection)



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



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



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



count
public int count(JMLType 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:   JMLValueBag.has(JMLType)



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



elements
public JMLValueBagEnumerator elements()(Code)
Returns an Enumeration over this bag.
See Also:   JMLValueBag.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 JMLValueBagEntry getMatchingEntry(JMLType item)(Code)
Find a JMLValueBagEntry 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(JMLType elem)(Code)
Tell whether the given element occurs ".equals" to an element in this bag.
Parameters:
  elem - the element sought.
See Also:   JMLValueBag.count(JMLType)



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



Methods inherited from org.jmlspecs.models.JMLValueBagSpecs
abstract public Object clone()(Code)(Java Doc)
abstract public int count(JMLType elem)(Code)(Java Doc)
public int count(Object elem)(Code)(Java Doc)
abstract public boolean has(JMLType elem)(Code)(Java Doc)
public boolean has(Object elem)(Code)(Java Doc)
abstract public JMLValueBag insert(JMLType elem)(Code)(Java Doc)
abstract public JMLValueBag insert(JMLType elem, int cnt) throws IllegalArgumentException(Code)(Java Doc)
abstract public int int_size()(Code)(Java Doc)

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.