Top Description Fields Constructors Methods
org.apache.commons.collections4.bag

public abstract Class AbstractSortedBagDecorator<E>

extends AbstractBagDecorator<E>
implements SortedBag<E>
Class Inheritance
All Implemented Interfaces
org.apache.commons.collections4.SortedBag, org.apache.commons.collections4.Bag, java.util.Collection, java.lang.Iterable
Known Direct Subclasses
org.apache.commons.collections4.bag.CollectionSortedBag, org.apache.commons.collections4.bag.UnmodifiableSortedBag
Type Parameters
<E>
the type of elements in this bag
Imports
java.util.Comparator, org.apache.commons.collections4.SortedBag

Decorates another SortedBag to provide additional behaviour.

Methods are forwarded directly to the decorated bag.

Since
3.0

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
protected
AbstractSortedBagDecorator()

Constructor only used in deserialization, do not use otherwise.

protected
AbstractSortedBagDecorator(final SortedBag<E>
the bag to decorate, must not be null
bag
)

Constructor that wraps (not copies).

Method Summary

Modifier and TypeMethod and Description
public Comparator<? super E>
comparator()

Implements org.apache.commons.collections4.SortedBag.comparator.

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

Returns:

the decorated bag
decorated
()

Overrides org.apache.commons.collections4.bag.AbstractBagDecorator.decorated.

Gets the bag being decorated.
public E
first()

Implements org.apache.commons.collections4.SortedBag.first.

Returns the first (lowest) member.
public E
last()

Implements org.apache.commons.collections4.SortedBag.last.

Returns the last (highest) member.
Inherited from org.apache.commons.collections4.bag.AbstractBagDecorator:
addequalsgetCounthashCoderemoveuniqueSet

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides org.apache.commons.collections4.bag.AbstractBagDecorator.serialVersionUID.

Serialization version

Constructor Detail

AbstractSortedBagDecoratorback to summary
protected AbstractSortedBagDecorator()

Constructor only used in deserialization, do not use otherwise.

Since
3.1
AbstractSortedBagDecoratorback to summary
protected AbstractSortedBagDecorator(final SortedBag<E> bag)

Constructor that wraps (not copies).

Parameters
bag:SortedBag<E>

the bag to decorate, must not be null

Exceptions
NullPointerException:
if bag is null

Method Detail

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

Implements org.apache.commons.collections4.SortedBag.comparator.

Doc from org.apache.commons.collections4.SortedBag.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

Annotations
@Override
decoratedback to summary
protected SortedBag<E> decorated()

Overrides org.apache.commons.collections4.bag.AbstractBagDecorator.decorated.

Gets the bag being decorated.

Returns:SortedBag<E>

the decorated bag

Annotations
@Override
firstback to summary
public E first()

Implements org.apache.commons.collections4.SortedBag.first.

Doc from org.apache.commons.collections4.SortedBag.first.

Returns the first (lowest) member.

Returns:E

the first element in the sorted bag

Annotations
@Override
lastback to summary
public E last()

Implements org.apache.commons.collections4.SortedBag.last.

Doc from org.apache.commons.collections4.SortedBag.last.

Returns the last (highest) member.

Returns:E

the last element in the sorted bag

Annotations
@Override