org.apache.commons.collections

Class TreeBag

public class TreeBag extends DefaultMapBag implements SortedBag

Deprecated: Moved to bag subpackage and rewritten internally. Due to be removed in v4.0.

A {@link Bag} that is backed by a {@link TreeMap}. Order will be maintained among the unique representative members.

Since: Commons Collections 2.0

Version: $Revision: 1.13 $ $Date: 2004/02/18 01:15:42 $

Author: Chuck Burdick

Constructor Summary
TreeBag()
Constructs an empty TreeBag.
TreeBag(Comparator comparator)
Constructs an empty {@link Bag} that maintains order on its unique representative members according to the given {@link Comparator}.
TreeBag(Collection coll)
Constructs a {@link Bag} containing all the members of the given collection.
Method Summary
Comparatorcomparator()
Objectfirst()
Objectlast()

Constructor Detail

TreeBag

public TreeBag()
Constructs an empty TreeBag.

TreeBag

public TreeBag(Comparator comparator)
Constructs an empty {@link Bag} that maintains order on its unique representative members according to the given {@link Comparator}.

Parameters: comparator the comparator to use

TreeBag

public TreeBag(Collection coll)
Constructs a {@link Bag} containing all the members of the given collection.

Parameters: coll the collection to copy into the bag

Method Detail

comparator

public Comparator comparator()

first

public Object first()

last

public Object last()
Copyright © 2001-2007 Apache Software Foundation. All Rights Reserved.