Example usage for Java org.apache.commons.collections15 Bag fields, constructors, methods, implement or subclass
The text is from its open source code.
boolean | add(E object, int nCopies) Adds nCopies copies of the specified object to the Bag. |
boolean | add(E object) (Violation) Adds one copy the specified object to the Bag. |
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(E 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. |
boolean | remove(E object, int nCopies) Removes nCopies copies of the specified object from the Bag. |
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. |