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
"==" element in this bag. |
public static JMLObjectBag | convertFrom(Object[] a) Return the bag containing all the elements in the given array. |
public static JMLObjectBag | convertFrom(java.util.Collection c) Return the bag containing all the object in the
given collection. |
public static JMLObjectBag | 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 "=="
to an element in this bag.
Parameters: elem - the element sought. |
public JMLObjectBag | difference(JMLObjectBag b2) Return a bag containing the items in this bag minus the
items in the given bag. |
public JMLObjectBagEnumerator | 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 JMLObjectBagEntry | getMatchingEntry(Object item) Find a JMLObjectBagEntry that is for the same element, if possible.
Parameters: item - the item sought. |
public boolean | has(Object elem) Tell whether the given element occurs "=="
to an element in this bag. |
public int | hashCode() |
public JMLObjectBag | insert(Object elem) Return a bag containing the given item and the ones in
this bag. |
public JMLObjectBag | 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 JMLObjectBag | intersection(JMLObjectBag 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(JMLObjectBag b2) Tells whether every item in this bag is contained in the
argument, but the argument is strictly larger. |
public boolean | isProperSuperbag(JMLObjectBag b2) Tells whether every item in the argument is contained in this bag
argument, but this bag is strictly larger. |
public boolean | isSubbag(JMLObjectBag b2) Tells whether every item in this bag is contained in the argument. |
public boolean | isSuperbag(JMLObjectBag b2) Tells whether every item in the argument is contained in this bag. |
public JMLIterator | iterator() Returns an iterator over this bag. |
public JMLObjectBag | remove(Object elem) Return a bag containing the items in this bag except for
one of the given element. |
public JMLObjectBag | remove(Object elem, int cnt) Return a bag containing the items in this bag, except for
the given number of the given element. |
public JMLObjectBag | removeAll(Object elem) Return a bag containing the items in this bag, except for
all items that are "==" to the given item. |
public static JMLObjectBag | 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 JMLObjectSequence | toSequence() Return a new JMLObjectSequence containing all the elements of this. |
public JMLObjectSet | toSet() Return a new JMLObjectSet containing all the elements of this. |
public String | toString() Return a string representation of this object. |
public JMLObjectBag | union(JMLObjectBag b2) Return a bag containing the items in either this bag or the
given bag. |