public class TreeBag extends DefaultMapBag implements SortedBag, Bag
Bag that is backed by a TreeMap. Order will be maintained among the unique representative
members.| Constructor and Description |
|---|
TreeBag()
Constructs a new empty
TreeBag. |
TreeBag(java.util.Collection c)
New
Bag containing all the members of the given
collection. |
TreeBag(java.util.Comparator c)
New
Bag that maintains order on its unique
representative members according to the given Comparator. |
| Modifier and Type | Method and Description |
|---|---|
java.util.Comparator |
comparator()
Returns the comparator associated with this sorted set, or null
if it uses its elements' natural ordering.
|
java.lang.Object |
first()
Returns the first (lowest) member.
|
java.lang.Object |
last()
Returns the last (highest) member.
|
add, add, addAll, calcTotalSize, clear, contains, containsAll, containsAll, equals, getCount, getMap, hashCode, isEmpty, iterator, remove, remove, removeAll, retainAll, retainAll, setMap, size, toArray, toArray, toString, uniqueSetclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic TreeBag()
TreeBag.public TreeBag(java.util.Collection c)
Bag containing all the members of the given
collection.public TreeBag(java.util.Comparator c)
Bag that maintains order on its unique
representative members according to the given Comparator.public java.util.Comparator comparator()
SortedBagcomparator in interface SortedBagpublic java.lang.Object first()
SortedBagCopyright © 2001-2004 Apache Software Foundation. Documenation generated April 29 2013.