org.apache.commons.collections
Class TreeBag
java.lang.Object
|
+--org.apache.commons.collections.DefaultMapBag
|
+--org.apache.commons.collections.TreeBag
- public class TreeBag
- extends DefaultMapBag
- implements SortedBag, Bag
An implementation of Bag
that is backed by a TreeMap
. Order will be maintained among the unique representative
members.
- Since:
- 2.0
- Author:
- Chuck Burdick
Method Summary |
Comparator |
comparator()
Returns the comparator associated with this sorted set, or null
if it uses its elements' natural ordering. |
Object |
first()
Returns the first (lowest) member. |
Object |
last()
Returns the last (highest) member. |
Methods inherited from class org.apache.commons.collections.DefaultMapBag |
add,
add,
addAll,
calcTotalSize,
clear,
contains,
containsAll,
containsAll,
equals,
getCount,
getMap,
hashCode,
isEmpty,
iterator,
remove,
remove,
removeAll,
retainAll,
retainAll,
setMap,
size,
toArray,
toArray,
toString,
uniqueSet |
TreeBag
public TreeBag()
- Constructs a new empty
TreeBag
.
TreeBag
public TreeBag(Comparator c)
- New
Bag
that maintains order on its unique
representative members according to the given Comparator
.
TreeBag
public TreeBag(Collection c)
- New
Bag
containing all the members of the given
collection.
- See Also:
DefaultMapBag.addAll(java.util.Collection)
first
public Object first()
- Description copied from interface: SortedBag
- Returns the first (lowest) member.
- Specified by:
- first in interface SortedBag
last
public Object last()
- Description copied from interface: SortedBag
- Returns the last (highest) member.
- Specified by:
- last in interface SortedBag
comparator
public Comparator comparator()
- Description copied from interface: SortedBag
- Returns the comparator associated with this sorted set, or null
if it uses its elements' natural ordering.
- Specified by:
- comparator in interface SortedBag
Copyright © 2001-2002 Apache Software Foundation. Documenation generated October 21 2002.