public interface NavigableSet
GDK enhancements for NavigableSet.
| Type Params | Return Type | Name and description |
|---|---|---|
<T> |
public NavigableSet<T> |
asChecked(Class<T> type)Creates a checked view of a NavigableSet. |
<T> |
public NavigableSet<T> |
asReversed()Creates a reverse order view of the set. |
<T> |
public NavigableSet<T> |
asSynchronized()Creates a synchronized view of a NavigableSet. |
<T> |
public NavigableSet<T> |
asUnmodifiable()Creates an unmodifiable view of a NavigableSet. |
<T> |
public NavigableSet<T> |
reverseEach(Closure closure)Iterate over each element of the set in reverse order. |
Creates a checked view of a NavigableSet.
Creates a reverse order view of the set. The order of original list will not change.
TreeSet navSet = [2, 4, 1, 3] // natural order is sorted
assert navSet.asReversed() == [4, 3, 2, 1] as Set
T - the type of elementCreates a synchronized view of a NavigableSet.
Creates an unmodifiable view of a NavigableSet.
Iterate over each element of the set in reverse order.
TreeSet navSet = [2, 4, 1, 3] // natural order is sorted
List result = []
navSet.reverseEach { result << it }
assert result == [4, 3, 2, 1]
closure - a closure to which each item is passed.