first()
:
Object
Returns the first (lowest) element currently in this sorted set.
headSet(key
:
Object)
:
SortedSet
Returns a view of the portion of this sorted set whose elements are strictly less than toElement.
last()
:
Object
Returns the last (highest) element currently in this sorted set.
subSet(from
:
Object, to
:
Object)
:
SortedSet
Returns a view of the portion of this sorted set whose elements range from fromElement, inclusive, to toElement, exclusive.
tailSet(key
:
Object)
:
SortedSet
Returns a view of the portion of this sorted set whose elements are greater than or equal to fromElement.
clone
Returns a shallow copy of this set.
Returns:
a shallow copy of this set.
first
Returns the first (lowest) element currently in this sorted set.
Returns:
the first (lowest) element currently in this sorted set.
headSet
Returns a view of the portion of this sorted set whose elements
are strictly less than toElement. The returned sorted set is
backed by this sorted set, so changes in the returned sorted
set are reflected in this sorted set, and vice-versa. The returned
sorted set supports all optional set operations.
Parameters:
key
-
high endpoint (exclusive) of the headSet.
Returns:
a view of the specified initial range of this sorted set.
last
Returns the last (highest) element currently in this sorted set.
Returns:
the last (highest) element currently in this sorted set.
subSet
Returns a view of the portion of this sorted set whose elements
range from fromElement, inclusive, to toElement, exclusive. (If
fromElement and toElement are equal, the returned sorted set is empty.)
The returned sorted set is backed by this sorted set, so changes in
the returned sorted set are reflected in this sorted set, and vice-versa.
The returned sorted set supports all optional set operations that this
sorted set supports.
Parameters:
from
-
low endpoint (inclusive) of the subSet.
to
-
high endpoint (exclusive) of the subSet.
Returns:
a view of the specified range within this sorted set.
tailSet
Returns a view of the portion of this sorted set whose elements
are greater than or equal to fromElement. The returned sorted set
is backed by this sorted set, so changes in the returned sorted
set are reflected in this sorted set, and vice-versa. The returned
sorted set supports all optional set operations.
Parameters:
key
-
low endpoint (inclusive) of the tailSet.
Returns:
a view of the specified final range of this sorted set.