public abstract class

AbstractSortedBagDecorator

extends AbstractBagDecorator
implements SortedBag
java.lang.Object
   ↳ org.apache.commons.collections.collection.AbstractCollectionDecorator
     ↳ org.apache.commons.collections.bag.AbstractBagDecorator
       ↳ org.apache.commons.collections.bag.AbstractSortedBagDecorator
Known Direct Subclasses

Class Overview

Decorates another SortedBag to provide additional behaviour.

Methods are forwarded directly to the decorated bag.

Summary

[Expand]
Inherited Fields
From class org.apache.commons.collections.collection.AbstractCollectionDecorator
Protected Constructors
AbstractSortedBagDecorator()
Constructor only used in deserialization, do not use otherwise.
AbstractSortedBagDecorator(SortedBag bag)
Constructor that wraps (not copies).
Public Methods
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.
Protected Methods
SortedBag getSortedBag()
Gets the bag being decorated.
[Expand]
Inherited Methods
From class org.apache.commons.collections.bag.AbstractBagDecorator
From class org.apache.commons.collections.collection.AbstractCollectionDecorator
From class java.lang.Object
From interface java.lang.Iterable
From interface java.util.Collection
From interface org.apache.commons.collections.Bag
From interface org.apache.commons.collections.SortedBag

Protected Constructors

protected AbstractSortedBagDecorator ()

Constructor only used in deserialization, do not use otherwise.

protected AbstractSortedBagDecorator (SortedBag bag)

Constructor that wraps (not copies).

Parameters
bag the bag to decorate, must not be null
Throws
IllegalArgumentException if list is null

Public Methods

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

public Object first ()

Returns the first (lowest) member.

Returns
  • the first element in the sorted bag

public Object last ()

Returns the last (highest) member.

Returns
  • the last element in the sorted bag

Protected Methods

protected SortedBag getSortedBag ()

Gets the bag being decorated.

Returns
  • the decorated bag