org.apache.commons.collections

Interface SortedBag

All Superinterfaces:
Bag, Collection
Known Implementing Classes:
AbstractSortedBagDecorator, PredicatedSortedBag, SynchronizedSortedBag, TransformedSortedBag, TreeBag, TreeBag, UnmodifiableSortedBag

public interface SortedBag
extends Bag

Defines a type of Bag that maintains a sorted order among its unique representative members.

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

Author:
Chuck Burdick

Since:
Commons Collections 2.0

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 interface org.apache.commons.collections.Bag

add, add, containsAll, getCount, iterator, remove, remove, removeAll, retainAll, size, uniqueSet

Method Details

comparator

public Comparator comparator()
Returns the comparator associated with this sorted set, or null if it uses its elements' natural ordering.

Returns:
the comparator in use, or null if natural ordering


first

public Object first()
Returns the first (lowest) member.

Returns:
the first element in the sorted bag


last

public Object last()
Returns the last (highest) member.

Returns:
the last element in the sorted bag


Copyright © 2001-2005 Apache Software Foundation. All Rights Reserved.