T - the type of elements maintained by this Collectionpublic class ObjectRBTreeSet<T> extends AbstractObjectSet<T> implements ObjectNavigableSet<T>
| Constructor and Description |
|---|
ObjectRBTreeSet()
Default Constructor
|
ObjectRBTreeSet(java.util.Collection<? extends T> collection)
A Helper constructor that allows to create a Set with exactly the same values as the provided collection.
|
ObjectRBTreeSet(java.util.Collection<? extends T> collection,
java.util.Comparator<T> comp)
A Helper constructor that allows to create a Set with exactly the same values as the provided collection.
|
ObjectRBTreeSet(java.util.Comparator<T> comp)
Constructor that allows to define the sorter
|
ObjectRBTreeSet(java.util.Iterator<T> iterator)
A Helper constructor that allows to create a set from a iterator of an unknown size
|
ObjectRBTreeSet(java.util.Iterator<T> iterator,
java.util.Comparator<T> comp)
A Helper constructor that allows to create a set from a iterator of an unknown size
|
ObjectRBTreeSet(ObjectCollection<T> collection)
A Helper constructor that allows to create a Set with exactly the same values as the provided collection.
|
ObjectRBTreeSet(ObjectCollection<T> collection,
java.util.Comparator<T> comp)
A Helper constructor that allows to create a Set with exactly the same values as the provided collection.
|
ObjectRBTreeSet(ObjectIterator<T> iterator)
A Helper constructor that allows to create a set from a iterator of an unknown size
|
ObjectRBTreeSet(ObjectIterator<T> iterator,
java.util.Comparator<T> comp)
A Helper constructor that allows to create a set from a iterator of an unknown size
|
ObjectRBTreeSet(ObjectSortedSet<T> sortedSet)
A Helper constructor that allows to create a Set with exactly the same values as the provided SortedSet.
|
ObjectRBTreeSet(T[] array)
Helper constructor that allow to create a set from an array
|
ObjectRBTreeSet(T[] array,
java.util.Comparator<T> comp)
Helper constructor that allow to create a set from an array
|
ObjectRBTreeSet(T[] array,
int offset,
int length)
Helper constructor that allow to create a set from an array
|
ObjectRBTreeSet(T[] array,
int offset,
int length,
java.util.Comparator<T> comp)
Helper constructor that allow to create a set from an array
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(T o) |
T |
addOrGet(T o)
A Helper method that allows to add a element or getting the already present implement.
|
T |
ceiling(T e) |
void |
clear() |
java.util.Comparator<T> |
comparator()
A Type Specific Comparator method
|
boolean |
contains(java.lang.Object e) |
ObjectRBTreeSet<T> |
copy()
A Function that does a shallow clone of the Collection itself.
|
int |
count(Object2BooleanFunction<T> filter)
Helper function to reduce stream usage that allows to count the valid elements.
|
ObjectBidirectionalIterator<T> |
descendingIterator() |
ObjectNavigableSet<T> |
descendingSet() |
T |
findFirst(Object2BooleanFunction<T> filter)
Helper function to reduce stream usage that allows to filter for the first match.
|
T |
first() |
T |
floor(T e) |
void |
forEach(java.util.function.Consumer<? super T> action) |
<E> void |
forEach(E input,
ObjectObjectConsumer<E,T> action)
Helper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.
|
T |
getDefaultMaxValue()
only used for primitives
|
T |
getDefaultMinValue()
only used for primitives
|
ObjectNavigableSet<T> |
headSet(T toElement,
boolean inclusive) |
T |
higher(T e) |
ObjectBidirectionalIterator<T> |
iterator()
Returns a Type-Specific Iterator to reduce (un)boxing
|
ObjectBidirectionalIterator<T> |
iterator(T fromElement)
A type Specific Iterator starting from a given key
|
T |
last() |
T |
lower(T e) |
boolean |
matchesAll(Object2BooleanFunction<T> filter)
Helper function to reduce stream usage that allows to filter for all matches.
|
boolean |
matchesAny(Object2BooleanFunction<T> filter)
Helper function to reduce stream usage that allows to filter for any matches.
|
boolean |
matchesNone(Object2BooleanFunction<T> filter)
Helper function to reduce stream usage that allows to filter for no matches.
|
T |
pollFirst()
A method to get and remove the first element in the set
|
T |
pollLast()
A method to get and remove the last element in the set
|
<E> E |
reduce(E identity,
java.util.function.BiFunction<E,T,E> operator)
Performs a reduction on the
elements of this Iterable
|
T |
reduce(ObjectObjectUnaryOperator<T,T> operator)
Performs a reduction on the
elements of this Iterable
|
boolean |
remove(java.lang.Object o) |
int |
size() |
ObjectNavigableSet<T> |
subSet(T fromElement,
boolean fromInclusive,
T toElement,
boolean toInclusive) |
ObjectNavigableSet<T> |
tailSet(T fromElement,
boolean inclusive) |
equals, hashCodeaddAll, containsAll, containsAll, containsAny, containsAny, removeAll, removeAll, retainAll, retainAlladdAll, isEmpty, removeAll, retainAll, toArray, toArray, toStringheadSet, spliterator, subSet, synchronize, synchronize, tailSet, unmodifiableaddAll, addAll, addAll, addAll, containsAll, containsAny, containsAny, pour, removeAll, removeAll, retainAll, retainAll, toArrayarrayflatMap, asAsync, distinct, filter, flatMap, limit, map, peek, pourAsList, pourAsSet, sortedpublic ObjectRBTreeSet()
public ObjectRBTreeSet(java.util.Comparator<T> comp)
comp - the function that decides how the tree is sorted, can be nullpublic ObjectRBTreeSet(T[] array)
array - the elements that should be usedpublic ObjectRBTreeSet(T[] array, int offset, int length)
array - the elements that should be usedoffset - the starting index within the arraylength - the amount of elements that are within the arrayjava.lang.IllegalStateException - if offset and length causes to step outside of the arrays rangepublic ObjectRBTreeSet(T[] array, java.util.Comparator<T> comp)
array - the elements that should be usedcomp - the sorter of the tree, can be nullpublic ObjectRBTreeSet(T[] array, int offset, int length, java.util.Comparator<T> comp)
array - the elements that should be usedoffset - the starting index within the arraylength - the amount of elements that are within the arraycomp - the sorter of the tree, can be nulljava.lang.IllegalStateException - if offset and length causes to step outside of the arrays rangepublic ObjectRBTreeSet(ObjectSortedSet<T> sortedSet)
sortedSet - the set the elements should be added to the TreeSetpublic ObjectRBTreeSet(java.util.Collection<? extends T> collection)
collection - the set the elements should be added to the TreeSetpublic ObjectRBTreeSet(java.util.Collection<? extends T> collection, java.util.Comparator<T> comp)
collection - the set the elements should be added to the TreeSetcomp - the sorter of the tree, can be nullpublic ObjectRBTreeSet(ObjectCollection<T> collection)
collection - the set the elements should be added to the TreeSetpublic ObjectRBTreeSet(ObjectCollection<T> collection, java.util.Comparator<T> comp)
collection - the set the elements should be added to the TreeSetcomp - the sorter of the tree, can be nullpublic ObjectRBTreeSet(java.util.Iterator<T> iterator)
iterator - the elements that should be added to the setpublic ObjectRBTreeSet(java.util.Iterator<T> iterator, java.util.Comparator<T> comp)
iterator - the elements that should be added to the setcomp - the sorter of the tree, can be nullpublic ObjectRBTreeSet(ObjectIterator<T> iterator)
iterator - the elements that should be added to the setpublic ObjectRBTreeSet(ObjectIterator<T> iterator, java.util.Comparator<T> comp)
iterator - the elements that should be added to the setcomp - the sorter of the tree, can be nullpublic T getDefaultMaxValue()
public T getDefaultMinValue()
public boolean add(T o)
public T addOrGet(T o)
ObjectSetpublic void forEach(java.util.function.Consumer<? super T> action)
forEach in interface java.lang.Iterable<T>public <E> void forEach(E input,
ObjectObjectConsumer<E,T> action)
ObjectIterableforEach in interface ObjectIterable<T>E - the generic type of the Objectinput - the object that should be includedaction - The action to be performed for each elementpublic boolean matchesAny(Object2BooleanFunction<T> filter)
ObjectIterablematchesAny in interface ObjectIterable<T>filter - that should be appliedpublic boolean matchesNone(Object2BooleanFunction<T> filter)
ObjectIterablematchesNone in interface ObjectIterable<T>filter - that should be appliedpublic boolean matchesAll(Object2BooleanFunction<T> filter)
ObjectIterablematchesAll in interface ObjectIterable<T>filter - that should be appliedpublic <E> E reduce(E identity,
java.util.function.BiFunction<E,T,E> operator)
ObjectIterablereduce in interface ObjectIterable<T>E - the type of elements maintained by this Collectionidentity - the start valueoperator - the operation that should be appliedpublic T reduce(ObjectObjectUnaryOperator<T,T> operator)
ObjectIterablereduce in interface ObjectIterable<T>operator - the operation that should be appliedpublic T findFirst(Object2BooleanFunction<T> filter)
ObjectIterablefindFirst in interface ObjectIterable<T>filter - that should be appliedpublic int count(Object2BooleanFunction<T> filter)
ObjectIterablecount in interface ObjectIterable<T>filter - that should be appliedpublic boolean contains(java.lang.Object e)
public boolean remove(java.lang.Object o)
public T pollFirst()
ObjectSortedSetpollFirst in interface java.util.NavigableSet<T>pollFirst in interface ObjectSortedSet<T>public T pollLast()
ObjectSortedSetpollLast in interface java.util.NavigableSet<T>pollLast in interface ObjectSortedSet<T>public int size()
public void clear()
public ObjectRBTreeSet<T> copy()
ObjectCollectioncopy in interface ObjectCollection<T>copy in interface ObjectNavigableSet<T>copy in interface ObjectSet<T>copy in interface ObjectSortedSet<T>copy in class AbstractObjectSet<T>public java.util.Comparator<T> comparator()
ObjectSortedSetcomparator in interface java.util.SortedSet<T>comparator in interface ObjectSortedSet<T>public ObjectBidirectionalIterator<T> iterator()
ObjectCollectioniterator in interface java.lang.Iterable<T>iterator in interface java.util.Collection<T>iterator in interface java.util.NavigableSet<T>iterator in interface java.util.Set<T>iterator in interface ObjectCollection<T>iterator in interface ObjectIterable<T>iterator in interface ObjectNavigableSet<T>iterator in interface ObjectSet<T>iterator in interface ObjectSortedSet<T>iterator in class AbstractObjectSet<T>Collection.iterator()public ObjectBidirectionalIterator<T> iterator(T fromElement)
ObjectSortedSetiterator in interface ObjectSortedSet<T>fromElement - the element the iterator should start frompublic ObjectBidirectionalIterator<T> descendingIterator()
descendingIterator in interface java.util.NavigableSet<T>descendingIterator in interface ObjectNavigableSet<T>public ObjectNavigableSet<T> subSet(T fromElement, boolean fromInclusive, T toElement, boolean toInclusive)
subSet in interface java.util.NavigableSet<T>subSet in interface ObjectNavigableSet<T>public ObjectNavigableSet<T> headSet(T toElement, boolean inclusive)
headSet in interface java.util.NavigableSet<T>headSet in interface ObjectNavigableSet<T>public ObjectNavigableSet<T> tailSet(T fromElement, boolean inclusive)
tailSet in interface java.util.NavigableSet<T>tailSet in interface ObjectNavigableSet<T>public ObjectNavigableSet<T> descendingSet()
descendingSet in interface java.util.NavigableSet<T>descendingSet in interface ObjectNavigableSet<T>