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

public abstract Class AbstractNavigableSetDecorator<E>

extends AbstractSortedSetDecorator<E>
implements NavigableSet<E>
Class Inheritance
All Implemented Interfaces
java.util.NavigableSet, 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.UnmodifiableNavigableSet
Type Parameters
<E>
the type of the elements in the navigable set
Imports
java.util.Iterator, .NavigableSet

Decorates another NavigableSet to provide additional behaviour.

Methods are forwarded directly to the decorated set.

Since
4.1

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
protected
AbstractNavigableSetDecorator()

Constructor only used in deserialization, do not use otherwise.

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

Constructor that wraps (not copies).

Method Summary

Modifier and TypeMethod and Description
public E
ceiling(final E
the value to match
e
)

Implements java.util.NavigableSet.ceiling.

Returns the least element in this set greater than or equal to the given element, or null if there is no such element.
protected NavigableSet<E>

Returns:

the decorated set
decorated
()

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

Gets the set being decorated.
public Iterator<E>
descendingIterator()

Implements java.util.NavigableSet.descendingIterator.

Returns an iterator over the elements in this set, in descending order.
public NavigableSet<E>
descendingSet()

Implements java.util.NavigableSet.descendingSet.

Returns a reverse order view of the elements contained in this set.
public E
floor(final E
the value to match
e
)

Implements java.util.NavigableSet.floor.

Returns the greatest element in this set less than or equal to the given element, or null if there is no such element.
public NavigableSet<E>
headSet(final E
high endpoint of the returned set
toElement
,
final boolean
true if the high endpoint is to be included in the returned view
inclusive
)

Implements java.util.NavigableSet.headSet.

Returns a view of the portion of this set whose elements are less than (or equal to, if inclusive is true) toElement.
public E
higher(final E
the value to match
e
)

Implements java.util.NavigableSet.higher.

Returns the least element in this set strictly greater than the given element, or null if there is no such element.
public E
lower(final E
the value to match
e
)

Implements java.util.NavigableSet.lower.

Returns the greatest element in this set strictly less than the given element, or null if there is no such element.
public E
pollFirst()

Implements java.util.NavigableSet.pollFirst.

Retrieves and removes the first (lowest) element, or returns null if this set is empty.
public E
pollLast()

Implements java.util.NavigableSet.pollLast.

Retrieves and removes the last (highest) element, or returns null if this set is empty.
public NavigableSet<E>
subSet(final E
low endpoint of the returned set
fromElement
,
final boolean
true if the low endpoint is to be included in the returned view
fromInclusive
,
final E
high endpoint of the returned set
toElement
,
final boolean
true if the high endpoint is to be included in the returned view
toInclusive
)

Implements java.util.NavigableSet.subSet.

Returns a view of the portion of this set whose elements range from fromElement to toElement.
public NavigableSet<E>
tailSet(final E
low endpoint of the returned set
fromElement
,
final boolean
true if the low endpoint is to be included in the returned view
inclusive
)

Implements java.util.NavigableSet.tailSet.

Returns a view of the portion of this set whose elements are greater than (or equal to, if inclusive is true) fromElement.
Inherited from org.apache.commons.collections4.set.AbstractSortedSetDecorator:
comparatorfirstheadSetlastsubSettailSet

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

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

Serialization version

Constructor Detail

AbstractNavigableSetDecoratorback to summary
protected AbstractNavigableSetDecorator()

Constructor only used in deserialization, do not use otherwise.

AbstractNavigableSetDecoratorback to summary
protected AbstractNavigableSetDecorator(final NavigableSet<E> set)

Constructor that wraps (not copies).

Parameters
set:NavigableSet<E>

the set to decorate, must not be null

Exceptions
NullPointerException:
if set is null

Method Detail

ceilingback to summary
public E ceiling(final E e)

Implements java.util.NavigableSet.ceiling.

Doc from java.util.NavigableSet.ceiling.

Returns the least element in this set greater than or equal to the given element, or null if there is no such element.

Parameters
e:E

the value to match

Returns:E

the least element greater than or equal to e, or null if there is no such element

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

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

Gets the set being decorated.

Returns:NavigableSet<E>

the decorated set

Annotations
@Override
descendingIteratorback to summary
public Iterator<E> descendingIterator()

Implements java.util.NavigableSet.descendingIterator.

Doc from java.util.NavigableSet.descendingIterator.

Returns an iterator over the elements in this set, in descending order. Equivalent in effect to descendingSet().iterator().

Returns:Iterator<E>

an iterator over the elements in this set, in descending order

Annotations
@Override
descendingSetback to summary
public NavigableSet<E> descendingSet()

Implements java.util.NavigableSet.descendingSet.

Doc from java.util.NavigableSet.descendingSet.

Returns a reverse order view of the elements contained in this set. The descending set is backed by this set, so changes to the set are reflected in the descending set, and vice-versa. If either set is modified while an iteration over either set is in progress (except through the iterator's own remove operation), the results of the iteration are undefined.

The returned set has an ordering equivalent to Collections.reverseOrder(comparator()). The expression s.descendingSet().descendingSet() returns a view of s essentially equivalent to s.

Returns:NavigableSet<E>

a reverse order view of this set

Annotations
@Override
floorback to summary
public E floor(final E e)

Implements java.util.NavigableSet.floor.

Doc from java.util.NavigableSet.floor.

Returns the greatest element in this set less than or equal to the given element, or null if there is no such element.

Parameters
e:E

the value to match

Returns:E

the greatest element less than or equal to e, or null if there is no such element

Annotations
@Override
headSetback to summary
public NavigableSet<E> headSet(final E toElement, final boolean inclusive)

Implements java.util.NavigableSet.headSet.

Doc from java.util.NavigableSet.headSet.

Returns a view of the portion of this set whose elements are less than (or equal to, if inclusive is true) 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 of the returned set

inclusive:boolean

true if the high endpoint is to be included in the returned view

Returns:NavigableSet<E>

a view of the portion of this set whose elements are less than (or equal to, if inclusive is true) toElement

Annotations
@Override
higherback to summary
public E higher(final E e)

Implements java.util.NavigableSet.higher.

Doc from java.util.NavigableSet.higher.

Returns the least element in this set strictly greater than the given element, or null if there is no such element.

Parameters
e:E

the value to match

Returns:E

the least element greater than e, or null if there is no such element

Annotations
@Override
lowerback to summary
public E lower(final E e)

Implements java.util.NavigableSet.lower.

Doc from java.util.NavigableSet.lower.

Returns the greatest element in this set strictly less than the given element, or null if there is no such element.

Parameters
e:E

the value to match

Returns:E

the greatest element less than e, or null if there is no such element

Annotations
@Override
pollFirstback to summary
public E pollFirst()

Implements java.util.NavigableSet.pollFirst.

Doc from java.util.NavigableSet.pollFirst.

Retrieves and removes the first (lowest) element, or returns null if this set is empty.

Returns:E

the first element, or null if this set is empty

Annotations
@Override
pollLastback to summary
public E pollLast()

Implements java.util.NavigableSet.pollLast.

Doc from java.util.NavigableSet.pollLast.

Retrieves and removes the last (highest) element, or returns null if this set is empty.

Returns:E

the last element, or null if this set is empty

Annotations
@Override
subSetback to summary
public NavigableSet<E> subSet(final E fromElement, final boolean fromInclusive, final E toElement, final boolean toInclusive)

Implements java.util.NavigableSet.subSet.

Doc from java.util.NavigableSet.subSet.

Returns a view of the portion of this set whose elements range from fromElement to toElement. If fromElement and toElement are equal, the returned set is empty unless fromInclusive and toInclusive are both true. 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 of the returned set

fromInclusive:boolean

true if the low endpoint is to be included in the returned view

toElement:E

high endpoint of the returned set

toInclusive:boolean

true if the high endpoint is to be included in the returned view

Returns:NavigableSet<E>

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

Annotations
@Override
tailSetback to summary
public NavigableSet<E> tailSet(final E fromElement, final boolean inclusive)

Implements java.util.NavigableSet.tailSet.

Doc from java.util.NavigableSet.tailSet.

Returns a view of the portion of this set whose elements are greater than (or equal to, if inclusive is true) 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 of the returned set

inclusive:boolean

true if the low endpoint is to be included in the returned view

Returns:NavigableSet<E>

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

Annotations
@Override