This set works the same way as TransformingSet, but also implements SortedSet.
A comparator can be specified during the construction of this set, which will be reported when comparator()
is called. When this set is used as the argument to a constructor of a sorted set (E.g.
TreeSet.TreeSet(
Important: Implementations should ensure that the transformed elements are ordered by the comparator of this constructed set. Violating this may result in undefined behaviour in some implementations.
The use-case for this map is the same as for TransformingSet. See the documentation of that class for more information.
protected final Comparator< | The comparator that this set is ordered by. |
public | TransformingSortedSet( Creates a new instance with the given set. |
public | TransformingSortedSet( Creates a new instance with the given set and comparator. |
public Comparator< | Returns the comparator used to order the elements in this set, or null if this set uses the
natural ordering of its elements. |
public E | first() Returns the first (lowest) element currently in this set. |
public SortedSet< | headSet( Returns a view of the portion of this set whose elements are strictly less than toElement. |
public E | last() Returns the last (highest) element currently in this set. |
public SortedSet< | subSet( Returns a view of the portion of this set whose elements range from fromElement, inclusive, to
toElement, exclusive. |
public SortedSet< | tailSet( Returns a view of the portion of this set whose elements are greater than or equal to fromElement. |
From: TransformingSet< |
From: SortedSet< |
From: AbstractSet< |
From: Set< |
From: AbstractCollection< |
From: Collection< |
From: Object |
null
.null
.The returned set will throw an IllegalArgumentException on an attempt to insert an element outside its range.
The returned set will throw an IllegalArgumentException on an attempt to insert an element outside its range.
The returned set will throw an IllegalArgumentException on an attempt to insert an element outside its range.