E
- the type of content of this Setpublic interface ImmutableSortedSet<E> extends ImmutableSet<E>
Copyright (c) 2013-2016 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
Modifier and Type | Method and Description |
---|---|
Comparator<? super E> |
comparator()
Returns the comparator used to order the elements in this immutable set, or null if this immutable set uses the
natural ordering of its elements.
|
boolean |
equals(Object obj)
Force to redefine equals for the implementations of immutable collection classes.
|
E |
first()
Returns the first (lowest) element currently in this immutable set.
|
int |
hashCode()
Force to redefine hashCode for the implementations of immutable collection classes.
|
ImmutableSortedSet<E> |
headSet(E toElement)
Returns a view of the portion of this immutable set whose elements are strictly less than toElement.
|
E |
last()
Returns the last (highest) element currently in this immutable set.
|
ImmutableSortedSet<E> |
subSet(E fromElement,
E toElement)
Returns a view of the portion of this immutable set whose elements range from fromElement, inclusive, to
toElement, exclusive.
|
ImmutableSortedSet<E> |
tailSet(E fromElement)
Returns a view of the portion of this immutable set whose elements are greater than or equal to fromElement.
|
SortedSet<E> |
toSet()
Returns a modifiable copy of this immutable set.
|
contains, containsAll, containsAll, isCopy, isEmpty, isWrap, iterator, parallelStream, size, spliterator, stream, toArray, toArray, toCollection
SortedSet<E> toSet()
toSet
in interface ImmutableSet<E>
Comparator<? super E> comparator()
ImmutableSortedSet<E> subSet(E fromElement, E toElement)
The result of this method is a new, immutable sorted set.
fromElement
- low endpoint (inclusive) of the returned immutable settoElement
- high endpoint (exclusive) of the returned immutable setClassCastException
- if fromElement and toElement cannot be compared to one another using this
immutable set's comparator (or, if the immutable set has no comparator, using natural ordering).
Implementations may, but are not required to, throw this exception if fromElement or
toElement cannot be compared to elements currently in the immutable set.NullPointerException
- if fromElement or toElement is null and this immutable set does not permit
null elementsIllegalArgumentException
- if fromElement is greater than toElement; or if this immutable set
itself has a restricted range, and fromElement or toElement lies outside the bounds of the
rangeImmutableSortedSet<E> headSet(E toElement)
The result of this method is a new, immutable sorted set.
toElement
- high endpoint (exclusive) of the returned immutable setClassCastException
- if toElement is not compatible with this immutable set's comparator (or, if the
immutable set has no comparator, if toElement does not implement Comparable
).
Implementations may, but are not required to, throw this exception if toElement cannot be compared
to elements currently in the immutable set.NullPointerException
- if toElement is null and this immutable set does not permit null elementsIllegalArgumentException
- if this immutable set itself has a restricted range, and toElement lies outside
the bounds of the rangeImmutableSortedSet<E> tailSet(E fromElement)
The result of this method is a new, immutable sorted set.
fromElement
- low endpoint (inclusive) of the returned immutable setClassCastException
- if fromElement is not compatible with this immutable set's comparator (or, if the
immutable set has no comparator, if fromElement does not implement Comparable
).
Implementations may, but are not required to, throw this exception if fromElement cannot be compared
to elements currently in the immutable set.NullPointerException
- if fromElement is null and this immutable set does not permit null elementsIllegalArgumentException
- if this immutable set itself has a restricted range, and fromElement lies
outside the bounds of the rangeE first()
NoSuchElementException
- if this immutable set is emptyE last()
NoSuchElementException
- if this immutable set is emptyboolean equals(Object obj)
equals
in interface ImmutableCollection<E>
equals
in interface ImmutableSet<E>
equals
in class Object
obj
- the object to compare this collection withint hashCode()
hashCode
in interface ImmutableCollection<E>
hashCode
in interface ImmutableSet<E>
hashCode
in class Object
Copyright © 2014–2016 Delft University of Technology. All rights reserved.