⇒ Index (Frames) |  ⇒ Index (No Frames) |  ⇒ Package |  ⇒ Package Tree |  ⇒ Full Tree 
org.apache.commons.collections

Class TreeBag

java.lang.Object
|
+--org.apache.commons.collections.DefaultMapBag
   |
   +--org.apache.commons.collections.TreeBag

All Implemented Interfaces:
Bag, SortedBag


public class TreeBag
extends DefaultMapBag
implements SortedBag

A Bag that is backed by a TreeMap. Order will be maintained among the unique representative members.
Since:
Commons Collections 2.0
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

Comparator

comparator()

Object

first()

Object

last()

Constructor Details

TreeBag

public TreeBag()

Constructs an empty TreeBag.


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

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

Method Details

comparator

public Comparator comparator()


first

public Object first()


last

public Object last()