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

public abstract Class AbstractSortedSetDecorator<E>

extends AbstractSetDecorator<E>
implements SortedSet<E>
Class Inheritance
All Implemented Interfaces
java.util.SortedSet, java.util.SequencedSet, java.util.Set, java.util.Collection, java.lang.Iterable, java.util.SequencedCollection
Known Direct Subclasses
org.apache.commons.collections4.set.UnmodifiableSortedSet, org.apache.commons.collections4.set.AbstractNavigableSetDecorator
Type Parameters
<E>
the type of the elements in the sorted set
Imports
java.util.Comparator, .Set, .SortedSet

Decorates another SortedSet to provide additional behaviour.

Methods are forwarded directly to the decorated set.

Since
3.0

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
protected
AbstractSortedSetDecorator()

Constructor only used in deserialization, do not use otherwise.

protected
AbstractSortedSetDecorator(final Set<E>
the set to decorate, must not be null
set
)

Constructor that wraps (not copies).

Method Summary

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

Implements java.util.SortedSet.comparator.

Returns the comparator used to order the elements in this set, or null if this set uses the natural ordering of its elements.
protected SortedSet<E>

Returns:

the decorated set
decorated
()

Overrides org.apache.commons.collections4.set.AbstractSetDecorator.decorated.

Gets the set being decorated.
public E
first()

Implements java.util.SortedSet.first.

Returns the first (lowest) element currently in this set.
public SortedSet<E>
headSet(final E
high endpoint (exclusive) of the returned set
toElement
)

Implements java.util.SortedSet.headSet.

Returns a view of the portion of this set whose elements are strictly less than toElement.
public E
last()

Implements java.util.SortedSet.last.

Returns the last (highest) element currently in this set.
public SortedSet<E>
subSet(final E
low endpoint (inclusive) of the returned set
fromElement
,
final E
high endpoint (exclusive) of the returned set
toElement
)

Implements java.util.SortedSet.subSet.

Returns a view of the portion of this set whose elements range from fromElement, inclusive, to toElement, exclusive.
public SortedSet<E>
tailSet(final E
low endpoint (inclusive) of the returned set
fromElement
)

Implements java.util.SortedSet.tailSet.

Returns a view of the portion of this set whose elements are greater than or equal to fromElement.
Inherited from org.apache.commons.collections4.set.AbstractSetDecorator:
equalshashCode

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides org.apache.commons.collections4.set.AbstractSetDecorator.serialVersionUID.

Serialization version

Constructor Detail

AbstractSortedSetDecoratorback to summary
protected AbstractSortedSetDecorator()

Constructor only used in deserialization, do not use otherwise.

Since
3.1
AbstractSortedSetDecoratorback to summary
protected AbstractSortedSetDecorator(final Set<E> set)

Constructor that wraps (not copies).

Parameters
set:Set<E>

the set to decorate, must not be null

Exceptions
NullPointerException:
if set is null

Method Detail

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

Implements java.util.SortedSet.comparator.

Doc from java.util.SortedSet.comparator.

Returns the comparator used to order the elements in this set, or null if this set uses the natural ordering of its elements.

Returns:Comparator<? super E>

the comparator used to order the elements in this set, or null if this set uses the natural ordering of its elements

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

Overrides org.apache.commons.collections4.set.AbstractSetDecorator.decorated.

Gets the set being decorated.

Returns:SortedSet<E>

the decorated set

Annotations
@Override
firstback to summary
public E first()

Implements java.util.SortedSet.first.

Doc from java.util.SortedSet.first.

Returns the first (lowest) element currently in this set.

Returns:E

the first (lowest) element currently in this set

Annotations
@Override
headSetback to summary
public SortedSet<E> headSet(final E toElement)

Implements java.util.SortedSet.headSet.

Doc from java.util.SortedSet.headSet.

Returns a view of the portion of this set whose elements are strictly less than toElement. The returned set is backed by this set, so changes in the returned set are reflected in this set, and vice-versa. The returned set supports all optional set operations that this set supports.

The returned set will throw an IllegalArgumentException on an attempt to insert an element outside its range.

Parameters
toElement:E

high endpoint (exclusive) of the returned set

Returns:SortedSet<E>

a view of the portion of this set whose elements are strictly less than toElement

Annotations
@Override
lastback to summary
public E last()

Implements java.util.SortedSet.last.

Doc from java.util.SortedSet.last.

Returns the last (highest) element currently in this set.

Returns:E

the last (highest) element currently in this set

Annotations
@Override
subSetback to summary
public SortedSet<E> subSet(final E fromElement, final E toElement)

Implements java.util.SortedSet.subSet.

Doc from java.util.SortedSet.subSet.

Returns a view of the portion of this set whose elements range from fromElement, inclusive, to toElement, exclusive. (If fromElement and toElement are equal, the returned set is empty.) The returned set is backed by this set, so changes in the returned set are reflected in this set, and vice-versa. The returned set supports all optional set operations that this set supports.

The returned set will throw an IllegalArgumentException on an attempt to insert an element outside its range.

Parameters
fromElement:E

low endpoint (inclusive) of the returned set

toElement:E

high endpoint (exclusive) of the returned set

Returns:SortedSet<E>

a view of the portion of this set whose elements range from fromElement, inclusive, to toElement, exclusive

Annotations
@Override
tailSetback to summary
public SortedSet<E> tailSet(final E fromElement)

Implements java.util.SortedSet.tailSet.

Doc from java.util.SortedSet.tailSet.

Returns a view of the portion of this set whose elements are greater than or equal to fromElement. The returned set is backed by this set, so changes in the returned set are reflected in this set, and vice-versa. The returned set supports all optional set operations that this set supports.

The returned set will throw an IllegalArgumentException on an attempt to insert an element outside its range.

Parameters
fromElement:E

low endpoint (inclusive) of the returned set

Returns:SortedSet<E>

a view of the portion of this set whose elements are greater than or equal to fromElement

Annotations
@Override