-
Method Summary
Returns a set that adds the specified value if it doesn't already exist in this set.
Returns an immutable view of this set as an instance of java.util.SortedSet
.
Returns the comparator associated with this map, or null
if the default ordering is used.
Returns a set containing all elements in this set, excluding the first number
of elements.
Returns the first element in the set or null
of the set is empty.
from(E value,
boolean inclusive)
Returns the bottom of the set starting from the key specified.
Returns the last element in the set or null
of the set is empty.
range(E from,
boolean fromInclusive,
E to,
boolean toInclusive)
Returns a subset of the set between the from
and to
keys specified.
Removes the specified value from the set if it exists.
Returns a set containing the first number
of elements from this set.
to(E value,
boolean inclusive)
Returns the top of the set up until the key specified.
Methods inherited from interface com.github.andrewoma.dexx.collection.Iterable
iterator
Methods inherited from interface com.github.andrewoma.dexx.collection.Set
asSet, contains
Methods inherited from interface com.github.andrewoma.dexx.collection.Traversable
forEach, isEmpty, makeString, makeString, size, to, toArray, toArray, toIndexedList, toSet, toSortedSet
-
Method Details
-
first
Returns the first element in the set or null
of the set is empty.
-
last
Returns the last element in the set or null
of the set is empty.
-
drop
Returns a set containing all elements in this set, excluding the first number
of elements.
-
take
Returns a set containing the first number
of elements from this set.
-
add
Description copied from interface: Set
Returns a set that adds the specified value if it doesn't already exist in this set.
- Specified by:
add
in interface Set<E>
-
remove
Description copied from interface: Set
Removes the specified value from the set if it exists.
- Specified by:
remove
in interface Set<E>
-
comparator
Returns the comparator associated with this map, or null
if the default ordering is used.
-
from
@NotNull
@NotNull SortedSet<E> from(@NotNull
E value,
boolean inclusive)
Returns the bottom of the set starting from the key specified.
- Parameters:
inclusive
- if true, the key will be included in the result, otherwise it will be excluded
-
to
@NotNull
@NotNull SortedSet<E> to(@NotNull
E value,
boolean inclusive)
Returns the top of the set up until the key specified.
- Parameters:
inclusive
- if true, the key will be included in the result, otherwise it will be excluded
-
range
@NotNull
@NotNull SortedSet<E> range(@NotNull
E from,
boolean fromInclusive,
@NotNull
E to,
boolean toInclusive)
Returns a subset of the set between the from
and to
keys specified.
- Parameters:
fromInclusive
- if true, the key will be included in the result, otherwise it will be excluded
toInclusive
- if true, the key will be included in the result, otherwise it will be excluded
-
asSortedSet
Returns an immutable view of this set as an instance of java.util.SortedSet
.