java.lang.Object | +--org.apache.commons.collections.bag.AbstractMapBag | +--org.apache.commons.collections.bag.TreeBagAll Implemented Interfaces:
TreeBag() Constructs an empty TreeBag. |
TreeBag(Comparator comparator) Constructs an empty bag that maintains order on its unique representative members according to the given Comparator. |
TreeBag(Collection coll) Constructs a TreeBag containing all the members of the specified collection. |
Comparator | |
Object | first() |
Object | last() |
public TreeBag()
TreeBag
.
public TreeBag(Collection coll)
TreeBag
containing all the members of the
specified collection.
public TreeBag(Comparator comparator)
public Comparator comparator()
public Object first()
public Object last()
SortedBag
, using aTreeMap
to provide the data storage. This is the standard implementation of a sorted bag. Order will be maintained among the bag members and can be viewed through the iterator. ABag
stores each object in the collection together with a count of occurrences. Extra methods on the interface allow multiple copies of an object to be added or removed at once. It is important to read the interface javadoc carefully as several methods violate theCollection
interface specification.