|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.github.andrewoma.dexx.collection.internal.base.AbstractTraversable<E>
com.github.andrewoma.dexx.collection.internal.base.AbstractIterable<E>
com.github.andrewoma.dexx.collection.internal.base.AbstractSet<E>
com.github.andrewoma.dexx.collection.internal.base.AbstractSortedSet<E>
com.github.andrewoma.dexx.collection.TreeSet<E>
public class TreeSet<E>
TreeSet is an implementation of SortedSet backed by a TreeMap.
| Field Summary | |
|---|---|
protected static TreeSet |
EMPTY
|
| Constructor Summary | |
|---|---|
TreeSet()
|
|
TreeSet(Comparator<? super E> ordering)
|
|
| Method Summary | ||
|---|---|---|
TreeSet<E> |
add(E value)
Returns a set that adds the specified value if it doesn't already exist in this set. |
|
Comparator<? super E> |
comparator()
Returns the comparator associated with this map, or null if the default ordering is used. |
|
boolean |
contains(E value)
Returns true if the value exists in this set. |
|
SortedSet<E> |
drop(int number)
Returns a set containing all elements in this set, excluding the first number of elements. |
|
static
|
empty()
|
|
static
|
factory(Comparator<? super E> ordering)
|
|
E |
first()
Returns the first element in the set or null of the set is empty. |
|
SortedSet<E> |
from(E value,
boolean inclusive)
Returns the bottom of the set starting from the key specified. |
|
Iterator<E> |
iterator()
|
|
E |
last()
Returns the last element in the set or null of the set is empty. |
|
SortedSet<E> |
range(E from,
boolean fromInclusive,
E to,
boolean toInclusive)
Returns a subset of the set between the from and to keys specified. |
|
TreeSet<E> |
remove(E value)
Removes the specified value from the set if it exists. |
|
int |
size()
Returns the size of the collection. |
|
SortedSet<E> |
take(int number)
Returns a set containing the first number of elements from this set. |
|
SortedSet<E> |
to(E value,
boolean inclusive)
Returns the top of the set up until the key specified. |
|
| Methods inherited from class com.github.andrewoma.dexx.collection.internal.base.AbstractSortedSet |
|---|
asSortedSet |
| Methods inherited from class com.github.andrewoma.dexx.collection.internal.base.AbstractSet |
|---|
asSet, equals, hashCode |
| Methods inherited from class com.github.andrewoma.dexx.collection.internal.base.AbstractIterable |
|---|
forEach |
| Methods inherited from class com.github.andrewoma.dexx.collection.internal.base.AbstractTraversable |
|---|
isEmpty, makeString, makeString, to, toArray, toArray, toIndexedList, toSet, toSortedSet, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.github.andrewoma.dexx.collection.Set |
|---|
asSet |
| Methods inherited from interface com.github.andrewoma.dexx.collection.Traversable |
|---|
forEach, isEmpty, makeString, makeString, to, toArray, toArray, toIndexedList, toSet, toSortedSet |
| Field Detail |
|---|
protected static final TreeSet EMPTY
| Constructor Detail |
|---|
public TreeSet()
public TreeSet(Comparator<? super E> ordering)
| Method Detail |
|---|
@NotNull public static <E> BuilderFactory<E,TreeSet<E>> factory(Comparator<? super E> ordering)
@NotNull public static <E> TreeSet<E> empty()
public Comparator<? super E> comparator()
SortedSetnull if the default ordering is used.
@NotNull public TreeSet<E> add(E value)
Set
@NotNull public TreeSet<E> remove(E value)
Set
public boolean contains(E value)
Set
public int size()
TraversableWarning: infinite collections are possible, as are collections that require traversal to calculate the size.
size in interface Traversable<E>size in class AbstractTraversable<E>@Nullable public E first()
SortedSetnull of the set is empty.
@Nullable public E last()
SortedSetnull of the set is empty.
@NotNull public Iterator<E> iterator()
@NotNull public SortedSet<E> drop(int number)
SortedSetnumber of elements.
@NotNull public SortedSet<E> take(int number)
SortedSetnumber of elements from this set.
@NotNull
public SortedSet<E> from(@NotNull
E value,
boolean inclusive)
SortedSet
from in interface SortedSet<E>from in class AbstractSortedSet<E>inclusive - if true, the key will be included in the result, otherwise it will be excluded
@NotNull
public SortedSet<E> to(@NotNull
E value,
boolean inclusive)
SortedSet
to in interface SortedSet<E>to in class AbstractSortedSet<E>inclusive - if true, the key will be included in the result, otherwise it will be excluded
@NotNull
public SortedSet<E> range(@NotNull
E from,
boolean fromInclusive,
@NotNull
E to,
boolean toInclusive)
SortedSetfrom and to keys specified.
fromInclusive - if true, the key will be included in the result, otherwise it will be excludedtoInclusive - if true, the key will be included in the result, otherwise it will be excluded
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||