A set that further guarantees that its iterator
will traverse the set in ascending element order,
sorted according to the natural ordering of its
elements (only supported for Number, String,
Date, Money and Quantity), or by a comparator
provided at sorted set creation time.
The constructor takes a compare function as additional parameter. This comparator
determines identity and the order of the elements for this set.
The order of the elements is determined with a comparator (see PropertyComparator)
or with the help of the given function. The function must take two parameters
and return a value <=-1 if the first parameter is smaller than the second,
a value if >=1 if the first one is greater than the second parameter
and a value in between like 0 if both are equal.
Parameters:
comparator - an instance of a PropertyComparator or a comparison function
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.
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.
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.