Method Summary |
|
public Object | choose() Return an arbitrary element of this. |
public Object | clone() Return a clone of this object. |
public boolean | containsAll(java.util.Collection c) Tell whether, for each element in the given collection, there is a
".equals" element in this bag. |
public static JMLEqualsBag | convertFrom(Object[] a) Return the bag containing all the elements in the given array. |
public static JMLEqualsBag | convertFrom(java.util.Collection c) Return the bag containing all the object in the
given collection. |
public static JMLEqualsBag | convertFrom(JMLCollection c) Return the bag containing all the object in the
given JMLCollection. |
public int | count(Object elem) Tell how many times the given element occurs ".equals"
to an element in this bag.
Parameters: elem - the element sought. |
public JMLEqualsBag | difference(JMLEqualsBag b2) Return a bag containing the items in this bag minus the
items in the given bag. |
public JMLEqualsBagEnumerator | elements() Returns an Enumeration over this bag. |
public boolean | equals(Object b2) Test whether this object's value is equal to the given argument. |
protected JMLEqualsBagEntry | getMatchingEntry(Object item) Find a JMLEqualsBagEntry that is for the same element, if possible.
Parameters: item - the item sought. |
public boolean | has(Object elem) Tell whether the given element occurs ".equals"
to an element in this bag. |
public int | hashCode() |
public JMLEqualsBag | insert(Object elem) Return a bag containing the given item and the ones in
this bag. |
public JMLEqualsBag | insert(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 int | int_size() Tell the number of elements in this bag. |
public JMLEqualsBag | intersection(JMLEqualsBag b2) Return a bag containing the items in both this bag and the
given bag. |
public boolean | isEmpty() Tell whether this bag has no elements. |
public boolean | isProperSubbag(JMLEqualsBag b2) Tells whether every item in this bag is contained in the
argument, but the argument is strictly larger. |
public boolean | isProperSuperbag(JMLEqualsBag b2) Tells whether every item in the argument is contained in this bag
argument, but this bag is strictly larger. |
public boolean | isSubbag(JMLEqualsBag b2) Tells whether every item in this bag is contained in the argument. |
public boolean | isSuperbag(JMLEqualsBag b2) Tells whether every item in the argument is contained in this bag. |
public JMLIterator | iterator() Returns an iterator over this bag. |
public JMLEqualsBag | remove(Object elem) Return a bag containing the items in this bag except for
one of the given element. |
public JMLEqualsBag | remove(Object elem, int cnt) Return a bag containing the items in this bag, except for
the given number of the given element. |
public JMLEqualsBag | removeAll(Object elem) Return a bag containing the items in this bag, except for
all items that are ".equals" to the given item. |
public static JMLEqualsBag | singleton(Object e) Return the singleton bag containing the given element. |
public Object[] | toArray() Return a new array containing all the elements of this. |
public JMLEqualsSequence | toSequence() Return a new JMLEqualsSequence containing all the elements of this. |
public JMLEqualsSet | toSet() Return a new JMLEqualsSet containing all the elements of this. |
public String | toString() Return a string representation of this object. |
public JMLEqualsBag | union(JMLEqualsBag b2) Return a bag containing the items in either this bag or the
given bag. |