org.apache.commons.collections
public class TreeBag extends DefaultMapBag implements SortedBag
Deprecated: Moved to bag subpackage and rewritten internally. Due to be removed in v4.0.
A Bag that is backed by a TreeMap. Order will be maintained among the unique representative members.Since: Commons Collections 2.0
Version: $Revision: 155406 $ $Date: 2005-02-26 12:55:26 +0000 (Sat, 26 Feb 2005) $
Constructor Summary | |
---|---|
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 Bag containing all the members of the given
collection.
|
Method Summary | |
---|---|
Comparator | comparator() |
Object | first() |
Object | last() |
TreeBag
.Parameters: comparator the comparator to use
Parameters: coll the collection to copy into the bag