Top Description Methods
org.apache.commons.collections4

public Interface SortedBag<E>

extends Bag<E>
Known Direct Implementers
org.apache.commons.collections4.bag.AbstractSortedBagDecorator, org.apache.commons.collections4.bag.PredicatedSortedBag, org.apache.commons.collections4.bag.SynchronizedSortedBag, org.apache.commons.collections4.bag.TransformedSortedBag, org.apache.commons.collections4.bag.TreeBag
Type Parameters
<E>
the type of elements in this bag
Imports
java.util.Comparator

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

Method Summary

Modifier and TypeMethod and Description
public Comparator<? super E>

Returns:

the comparator in use, or null if natural ordering
comparator
()

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

public E

Returns:

the first element in the sorted bag
first
()

Returns the first (lowest) member.

public E

Returns:

the last element in the sorted bag
last
()

Returns the last (highest) member.

Inherited from org.apache.commons.collections4.Bag:
addaddcontainsAllgetCountiteratorremoveremoveremoveAllretainAllsizeuniqueSet

Method Detail

comparatorback to summary
public Comparator<? super E> comparator()

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

Returns:Comparator<? super E>

the comparator in use, or null if natural ordering

firstback to summary
public E first()

Returns the first (lowest) member.

Returns:E

the first element in the sorted bag

lastback to summary
public E last()

Returns the last (highest) member.

Returns:E

the last element in the sorted bag