Example usage for Java org.apache.commons.collections Bag fields, constructors, methods, implement or subclass
The text is from its open source code.
boolean | add(Object object, int nCopies) Adds nCopies copies of the specified object to the Bag. |
boolean | add(Object object) (Violation) Adds one copy the specified object to the Bag. |
boolean | addAll(Collection extends E> c) Adds all of the elements in the specified collection to this collection (optional operation). |
void | clear() Removes all of the elements from this collection (optional operation). |
boolean | contains(Object o) Returns true if this collection contains the specified element. |
int | getCount(Object object) Returns the number of occurrences (cardinality) of the given object currently in the bag. |
boolean | isEmpty() Returns true if this collection contains no elements. |
Iterator | iterator() Returns an Iterator over the entire set of members, including copies due to cardinality. |
boolean | remove(Object object, int nCopies) Removes nCopies copies of the specified object from the Bag. |
boolean | remove(Object object) (Violation) Removes all occurrences of the given object from the bag. |
boolean | removeAll(Collection coll) (Violation) Remove all elements represented in the given collection, respecting cardinality. |
int | size() Returns the total number of items in the bag across all types. |
Set | uniqueSet() Returns a Set of unique elements in the Bag. |