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 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) $

Author: Chuck Burdick

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
Comparatorcomparator()
Objectfirst()
Objectlast()

Constructor Detail

TreeBag

public TreeBag()
Constructs an empty TreeBag.

TreeBag

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

Parameters: comparator the comparator to use

TreeBag

public TreeBag(Collection coll)
Constructs a 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-2008 Apache Software Foundation. All Rights Reserved.