org.apache.commons.collections
Class TreeBag
- Bag, Collection, Bag, SortedBag
A
Bag that is backed by a
TreeMap.
Order will be maintained among the unique representative
members.
$Revision: 155406 $ $Date: 2005-02-26 12:55:26 +0000 (Sat, 26 Feb 2005) $TreeBag()- Constructs an empty
TreeBag.
|
TreeBag(Collection coll)- Constructs a
Bag containing all the members of the given
collection.
|
TreeBag(Comparator comparator)- Constructs an empty
Bag that maintains order on its unique
representative members according to the given Comparator.
|
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.
|
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 an empty TreeBag.
TreeBag
public TreeBag(Collection coll)
Constructs a
Bag containing all the members of the given
collection.
coll - the collection to copy into the bag
TreeBag
public TreeBag(Comparator comparator)
Constructs an empty
Bag that maintains order on its unique
representative members according to the given
Comparator.
comparator - the comparator to use
comparator
public Comparator comparator()
Returns the comparator associated with this sorted set, or null
if it uses its elements' natural ordering.
- comparator in interface SortedBag
- the comparator in use, or null if natural ordering
first
public Object first()
Returns the first (lowest) member.
- first in interface SortedBag
- the first element in the sorted bag
last
public Object last()
Returns the last (highest) member.
- last in interface SortedBag
- the last element in the sorted bag
Copyright © 2001-2015 Apache Software Foundation. All Rights Reserved.