Java org.apache.commons.collections Bag fields, constructors, methods, implement or subclass

Example usage for Java org.apache.commons.collections Bag fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for org.apache.commons.collections Bag.

The text is from its open source code.

Method

booleanadd(Object object, int nCopies)
Adds nCopies copies of the specified object to the Bag.
booleanadd(Object object)
(Violation) Adds one copy the specified object to the Bag.
booleanaddAll(Collection c)
Adds all of the elements in the specified collection to this collection (optional operation).
voidclear()
Removes all of the elements from this collection (optional operation).
booleancontains(Object o)
Returns true if this collection contains the specified element.
intgetCount(Object object)
Returns the number of occurrences (cardinality) of the given object currently in the bag.
booleanisEmpty()
Returns true if this collection contains no elements.
Iteratoriterator()
Returns an Iterator over the entire set of members, including copies due to cardinality.
booleanremove(Object object, int nCopies)
Removes nCopies copies of the specified object from the Bag.
booleanremove(Object object)
(Violation) Removes all occurrences of the given object from the bag.
booleanremoveAll(Collection coll)
(Violation) Remove all elements represented in the given collection, respecting cardinality.
intsize()
Returns the total number of items in the bag across all types.
SetuniqueSet()
Returns a Set of unique elements in the Bag.