org.apache.commons.collections

Interface SortedBag

public interface SortedBag extends Bag

Defines a type of Bag that maintains a sorted order among its 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

Method Summary
Comparatorcomparator()
Returns the comparator associated with this sorted set, or null if it uses its elements' natural ordering.
Objectfirst()
Returns the first (lowest) member.
Objectlast()
Returns the last (highest) member.

Method Detail

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-2008 Apache Software Foundation. All Rights Reserved.