public final class TreeSet<T> extends java.lang.Object implements ImmutableSortedSet<T>, Higher<DataWitness.treeSet,T>, java.io.Serializable
Constructor and Description |
---|
TreeSet(RedBlackTree.Tree<T,T> map,
java.util.Comparator<? super T> comp) |
Modifier and Type | Method and Description |
---|---|
TreeSet<T> |
add(T value) |
TreeSet<T> |
append(T append) |
TreeSet<T> |
appendAll(java.lang.Iterable<? extends T> it) |
TreeSet<T> |
appendAll(T... values) |
TreeSet<ReactiveSeq<T>> |
combinations() |
TreeSet<ReactiveSeq<T>> |
combinations(int size) |
TreeSet<T> |
combine(java.util.function.BiPredicate<? super T,? super T> predicate,
java.util.function.BinaryOperator<T> op)
Combine two adjacent elements in a traversable using the supplied BinaryOperator
This is a stateful grouping and reduction operation.
|
TreeSet<T> |
combine(Monoid<T> op,
java.util.function.BiPredicate<? super T,? super T> predicate)
Combine two adjacent elements in a traversable using the supplied BinaryOperator
This is a stateful grouping and reduction operation.
|
java.util.Comparator<? super T> |
comparator() |
<R> TreeSet<R> |
concatMap(java.util.function.Function<? super T,? extends java.lang.Iterable<? extends R>> fn)
Perform a flatMap operation on this IterableX.
|
<R> TreeSet<R> |
concatMap(java.util.function.Function<? super T,? extends java.lang.Iterable<? extends R>> fn,
java.util.Comparator<? super R> comp) |
boolean |
containsValue(T value) |
TreeSet<T> |
cycle(long times) |
TreeSet<T> |
cycle(Monoid<T> m,
long times) |
TreeSet<T> |
cycleUntil(java.util.function.Predicate<? super T> predicate) |
TreeSet<T> |
cycleWhile(java.util.function.Predicate<? super T> predicate) |
TreeSet<T> |
deleteBetween(int start,
int end)
Delete elements between given indexes
|
TreeSet<T> |
distinct() |
ImmutableSortedSet<T> |
drop(int num) |
TreeSet<T> |
drop(long num)
assertThat(ReactiveSeq.of(4,3,6,7).drop(2).toList(),equalTo(Arrays.asList(6,7))); |
TreeSet<T> |
dropRight(int num)
Generate a new Traversable that drops the specified number elements from the take of this Traversable
|
TreeSet<T> |
dropUntil(java.util.function.Predicate<? super T> p)
Generate a new Traversable that drops elements from this Traversable until the predicate holds
|
TreeSet<T> |
dropWhile(java.util.function.Predicate<? super T> p)
Generate a new Traversable that drops elements from this Traversable as long as the predicate holds
|
Tuple2<TreeSet<T>,TreeSet<T>> |
duplicate() |
static <T extends java.lang.Comparable<? super T>> |
empty() |
static <T> TreeSet<T> |
empty(java.util.Comparator<? super T> comp) |
boolean |
equals(java.lang.Object o) |
TreeSet<T> |
filter(java.util.function.Predicate<? super T> predicate)
Keep only elements for which the supplied predicates hold
e.g.
|
TreeSet<T> |
filterNot(java.util.function.Predicate<? super T> predicate)
Remove any elements for which the predicate holds (inverse operation to filter)
e.g.
|
Option<T> |
first() |
<R> TreeSet<R> |
flatMap(java.util.function.Function<? super T,? extends ImmutableSet<? extends R>> fn) |
<R> TreeSet<R> |
flatMap(java.util.function.Function<? super T,? extends ImmutableSet<? extends R>> fn,
java.util.Comparator<? super R> comp) |
<R> R |
foldLeft(R zero,
java.util.function.BiFunction<R,? super T,R> f) |
<R1,R> TreeSet<R> |
forEach2(java.util.function.Function<? super T,? extends java.lang.Iterable<R1>> iterable1,
java.util.function.BiFunction<? super T,? super R1,? extends R> yieldingFunction) |
<R1,R> TreeSet<R> |
forEach2(java.util.function.Function<? super T,? extends java.lang.Iterable<R1>> iterable1,
java.util.function.BiFunction<? super T,? super R1,java.lang.Boolean> filterFunction,
java.util.function.BiFunction<? super T,? super R1,? extends R> yieldingFunction) |
<R1,R2,R> TreeSet<R> |
forEach3(java.util.function.Function<? super T,? extends java.lang.Iterable<R1>> iterable1,
java.util.function.BiFunction<? super T,? super R1,? extends java.lang.Iterable<R2>> iterable2,
Function3<? super T,? super R1,? super R2,? extends R> yieldingFunction) |
<R1,R2,R> TreeSet<R> |
forEach3(java.util.function.Function<? super T,? extends java.lang.Iterable<R1>> iterable1,
java.util.function.BiFunction<? super T,? super R1,? extends java.lang.Iterable<R2>> iterable2,
Function3<? super T,? super R1,? super R2,java.lang.Boolean> filterFunction,
Function3<? super T,? super R1,? super R2,? extends R> yieldingFunction) |
<R1,R2,R3,R> |
forEach4(java.util.function.Function<? super T,? extends java.lang.Iterable<R1>> iterable1,
java.util.function.BiFunction<? super T,? super R1,? extends java.lang.Iterable<R2>> iterable2,
Function3<? super T,? super R1,? super R2,? extends java.lang.Iterable<R3>> iterable3,
Function4<? super T,? super R1,? super R2,? super R3,? extends R> yieldingFunction) |
<R1,R2,R3,R> |
forEach4(java.util.function.Function<? super T,? extends java.lang.Iterable<R1>> iterable1,
java.util.function.BiFunction<? super T,? super R1,? extends java.lang.Iterable<R2>> iterable2,
Function3<? super T,? super R1,? super R2,? extends java.lang.Iterable<R3>> iterable3,
Function4<? super T,? super R1,? super R2,? super R3,java.lang.Boolean> filterFunction,
Function4<? super T,? super R1,? super R2,? super R3,? extends R> yieldingFunction) |
static <T extends java.lang.Comparable<? super T>> |
fromIterable(java.lang.Iterable<T> it) |
static <T> TreeSet<T> |
fromIterable(java.lang.Iterable<T> it,
java.util.Comparator<? super T> comp) |
static <T> TreeSet<T> |
fromSortedSet(java.util.SortedSet<T> set,
java.util.Comparator<? super T> comp) |
static <T> TreeSet<T> |
fromStream(java.util.stream.Stream<T> stream,
java.util.Comparator<? super T> comp) |
Option<T> |
get(int index) |
TreeSet<Vector<T>> |
grouped(int groupSize)
Group elements in a Stream
|
<C extends PersistentCollection<? super T>> |
grouped(int size,
java.util.function.Supplier<C> supplier)
Group the elements of this traversable
|
TreeSet<Vector<T>> |
groupedUntil(java.util.function.BiPredicate<Vector<? super T>,? super T> predicate)
Create Travesable of Lists where
each List is populated while the supplied bipredicate holds.
|
TreeSet<Vector<T>> |
groupedUntil(java.util.function.Predicate<? super T> predicate)
ReactiveSeq.of(1,2,3,4,5,6)
.groupedUntil(i->i%3==0)
.toList()
.size();
//2
|
<C extends PersistentCollection<? super T>> |
groupedUntil(java.util.function.Predicate<? super T> predicate,
java.util.function.Supplier<C> factory)
Create a ReactiveSeq batched by a Collection, where each batch is populated
until the predicate holds
|
TreeSet<Vector<T>> |
groupedWhile(java.util.function.Predicate<? super T> predicate)
Create a Traversable batched by List, where each batch is populated while
the predicate holds
|
<C extends PersistentCollection<? super T>> |
groupedWhile(java.util.function.Predicate<? super T> predicate,
java.util.function.Supplier<C> factory)
Create a SequenceM batched by a Collection, where each batch is populated
while the predicate holds
|
int |
hashCode() |
TreeSet<T> |
insertAt(int pos,
java.lang.Iterable<? extends T> values) |
TreeSet<T> |
insertAt(int pos,
T... values)
Insert data into a traversable at given position
|
TreeSet<T> |
insertAt(int i,
T value) |
TreeSet<T> |
insertStreamAt(int pos,
java.util.stream.Stream<T> stream)
Insert a Stream into the middle of this traversable at the specified position
|
TreeSet<T> |
intersperse(T value)
Returns a Traversable with a given value interspersed between any two values.
|
boolean |
isEmpty() |
java.util.Iterator<T> |
iterator() |
Option<T> |
last() |
<R> TreeSet<R> |
map(java.util.function.Function<? super T,? extends R> fn)
Transform this functor using the supplied transformation function
|
<R> TreeSet<R> |
map(java.util.function.Function<? super T,? extends R> fn,
java.util.Comparator<? super R> comp) |
<R> TreeSet<R> |
mergeMap(java.util.function.Function<? super T,? extends org.reactivestreams.Publisher<? extends R>> fn) |
<R> TreeSet<R> |
mergeMap(int maxConcurecy,
java.util.function.Function<? super T,? extends org.reactivestreams.Publisher<? extends R>> fn) |
java.lang.String |
mkString() |
TreeSet<T> |
notNull()
Filter elements retaining only values which are not null
|
static <T> TreeSet<T> |
of(java.util.Comparator<? super T> comp,
T... values) |
static <T extends java.lang.Comparable<? super T>> |
of(T... values) |
<U> TreeSet<U> |
ofType(java.lang.Class<? extends U> type)
Keep only those elements in a stream that are of a given type.
|
TreeSet<T> |
onEmpty(T value)
If this Container instance is zero, create a new instance containing the provided value
|
TreeSet<T> |
onEmptyGet(java.util.function.Supplier<? extends T> supplier)
If this Container instance is zero, create a new instance containing the value returned from the provided Supplier
|
TreeSet<T> |
peek(java.util.function.Consumer<? super T> c)
Peek at the current value of this Transformable, without transforming it
|
TreeSet<ReactiveSeq<T>> |
permutations() |
TreeSet<T> |
plus(T value) |
TreeSet<T> |
plusAll(java.lang.Iterable<? extends T> list) |
TreeSet<T> |
prepend(T value) |
TreeSet<T> |
prependAll(java.lang.Iterable<? extends T> value) |
TreeSet<T> |
prependAll(T... values)
List<String> result = ReactiveSeq.of(1,2,3)
.prependAll(100,200,300)
.map(it ->it+"!!")
.collect(CyclopsCollectors.toList());
//asList("100!!","200!!","300!!","1!!","2!!","3!!")));
|
TreeSet<T> |
prependStream(java.util.stream.Stream<? extends T> stream) |
java.lang.String |
printTree() |
TreeSet<T> |
removeAll(java.lang.Iterable<? extends T> list)
Remove all elements in the supplied Iterable from this filterable
|
TreeSet<T> |
removeAll(T... values)
Remove all supplied elements from this filterable
|
TreeSet<T> |
removeAt(long pos) |
TreeSet<T> |
removeFirst(java.util.function.Predicate<? super T> pred) |
TreeSet<T> |
removeStream(java.util.stream.Stream<? extends T> stream)
Remove all elements in the supplied Stream from this filterable
|
TreeSet<T> |
removeValue(T value) |
TreeSet<T> |
retainAll(java.lang.Iterable<? extends T> it)
Retain only the supplied elements in the returned Filters
|
TreeSet<T> |
retainAll(T... values)
Retain only the supplied elements in the returned Filters
|
TreeSet<T> |
retainStream(java.util.stream.Stream<? extends T> stream)
Retain only the supplied elements in the returned Filters
|
TreeSet<T> |
reverse() |
TreeSet<T> |
scanLeft(Monoid<T> monoid)
Scan left using supplied Monoid
|
<U> TreeSet<U> |
scanLeft(U seed,
java.util.function.BiFunction<? super U,? super T,? extends U> function)
Scan left
|
TreeSet<T> |
scanRight(Monoid<T> monoid)
Scan right
|
<U> TreeSet<U> |
scanRight(U identity,
java.util.function.BiFunction<? super T,? super U,? extends U> combiner)
Scan right
|
TreeSet<T> |
shuffle() |
TreeSet<T> |
shuffle(java.util.Random random) |
static <T> TreeSet<T> |
singleton(java.util.Comparator<? super T> comp,
T value) |
static <T extends java.lang.Comparable<? super T>> |
singleton(T value) |
int |
size() |
TreeSet<T> |
slice(long from,
long to) |
TreeSet<Seq<T>> |
sliding(int windowSize)
Create a sliding view
|
TreeSet<Seq<T>> |
sliding(int windowSize,
int increment)
Create a sliding view
|
TreeSet<T> |
sorted()
{@code ReactiveSeq.of(4,3,6,7))
.sorted()
.toList()
//Arrays.asList(3,4,6,7)
|
TreeSet<T> |
sorted(java.util.Comparator<? super T> c)
assertThat(ReactiveSeq.of(4,3,6,7).sorted((a,b) -> b-a).toList(),equalTo(Arrays.asList(7,6,4,3)));
|
<U extends java.lang.Comparable<? super U>> |
sorted(java.util.function.Function<? super T,? extends U> function) |
ReactiveSeq<T> |
stream() |
ImmutableSortedSet<T> |
subSet(T fromElement,
T toElement) |
ImmutableSortedSet<T> |
take(int num) |
TreeSet<T> |
take(long n)
{@code
ReactiveSeq.of(4,3,6,7)
.take(2)
.toList()
asList(4,3)
|
TreeSet<T> |
takeRight(int num)
Generate a new Traversable that takes the specified number elements from the take of this Traversable
|
TreeSet<T> |
takeUntil(java.util.function.Predicate<? super T> p)
Generate a new Traversable that takes elements from this Traversable until the predicate holds
|
TreeSet<T> |
takeWhile(java.util.function.Predicate<? super T> p)
Generate a new Traversable that takes elements from this Traversable as long as the predicate holds
|
java.lang.String |
toString() |
<R> TreeSet<R> |
unitIterable(java.lang.Iterable<R> it) |
<R> TreeSet<R> |
unitStream(java.util.stream.Stream<R> stream) |
ImmutableSortedSet<T> |
unitStream(java.util.stream.Stream<T> stream,
java.util.Comparator<? super T> comp) |
<R1,R2> Tuple2<TreeSet<R1>,TreeSet<R2>> |
unzip(java.util.function.Function<? super T,Tuple2<? extends R1,? extends R2>> fn) |
TreeSet<T> |
updateAt(int pos,
T value) |
<T2,R> TreeSet<R> |
zip(java.util.function.BiFunction<? super T,? super T2,? extends R> fn,
org.reactivestreams.Publisher<? extends T2> publisher)
Zip (combine) this Zippable with the supplied Publisher, using the supplied combining function
|
<U> TreeSet<Tuple2<T,U>> |
zip(java.lang.Iterable<? extends U> other) |
<U,R> TreeSet<R> |
zip(java.lang.Iterable<? extends U> other,
java.util.function.BiFunction<? super T,? super U,? extends R> zipper)
Zip (combine) this Zippable with the supplied Iterable using the supplied combining function
|
<S,U> TreeSet<Tuple3<T,S,U>> |
zip3(java.lang.Iterable<? extends S> second,
java.lang.Iterable<? extends U> third) |
<S,U,R> TreeSet<R> |
zip3(java.lang.Iterable<? extends S> second,
java.lang.Iterable<? extends U> third,
Function3<? super T,? super S,? super U,? extends R> fn3) |
<T2,T3,T4> TreeSet<Tuple4<T,T2,T3,T4>> |
zip4(java.lang.Iterable<? extends T2> second,
java.lang.Iterable<? extends T3> third,
java.lang.Iterable<? extends T4> fourth) |
<T2,T3,T4,R> |
zip4(java.lang.Iterable<? extends T2> second,
java.lang.Iterable<? extends T3> third,
java.lang.Iterable<? extends T4> fourth,
Function4<? super T,? super T2,? super T3,? super T4,? extends R> fn) |
TreeSet<Tuple2<T,java.lang.Long>> |
zipWithIndex() |
<U> TreeSet<Tuple2<T,U>> |
zipWithPublisher(org.reactivestreams.Publisher<? extends U> other) |
<U> TreeSet<Tuple2<T,U>> |
zipWithStream(java.util.stream.Stream<? extends U> other) |
<U,R> TreeSet<R> |
zipWithStream(java.util.stream.Stream<? extends U> other,
java.util.function.BiFunction<? super T,? super U,? extends R> zipper) |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
partition, span, splitAt, splitBy, traversable
onEmptySwitch, onEmptyTry
asFunction, equalToIteration, foldFuture, foldLazy, foldTry, forEach, forEach, forEach, forEach, forEach, forEachSubscribe, forEachSubscribe, forEachSubscribe, runFuture, runLazy, seq, to, toHashSet
fixedDelay, insertAt, onePer, subscribe, xPer
allMatch, anyMatch, atPercentile, bankersQueue, collect, collect, collect, collect, count, countDistinct, doubleStats, elementAt, endsWith, firstValue, foldLeft, foldLeft, foldLeft, foldLeft, foldLeft, foldMap, foldMap, foldMapRight, foldRight, foldRight, foldRight, groupBy, hashSet, headOption, indexOf, indexOfSlice, intStats, iterableTo, join, join, join, lastIndexOf, lastIndexOfSlice, lazySeq, longStats, maxBy, maxBy, maximum, mean, median, minBy, minBy, minimum, mode, noneMatch, nonEmptyList, occurances, populationVariance, print, print, printErr, printOut, scheduleStream, single, single, singleOrElse, startsWith, stdDeviation, sumDouble, sumInt, sumLong, takeOne, toArray, toArray, toCollection, toHashMap, toHashMap, toList, toMap, toMap, toSet, treeSet, variance, vector, withPercentiles, xMatch
sortedSetView
setView
public TreeSet(RedBlackTree.Tree<T,T> map, java.util.Comparator<? super T> comp)
public static <T extends java.lang.Comparable<? super T>> TreeSet<T> empty()
public static <T extends java.lang.Comparable<? super T>> TreeSet<T> singleton(T value)
public static <T> TreeSet<T> singleton(java.util.Comparator<? super T> comp, T value)
public static <T> TreeSet<T> empty(java.util.Comparator<? super T> comp)
public static <T> TreeSet<T> fromStream(java.util.stream.Stream<T> stream, java.util.Comparator<? super T> comp)
public static <T> TreeSet<T> fromIterable(java.lang.Iterable<T> it, java.util.Comparator<? super T> comp)
public static <T extends java.lang.Comparable<? super T>> TreeSet<T> fromIterable(java.lang.Iterable<T> it)
public <R> TreeSet<R> unitIterable(java.lang.Iterable<R> it)
unitIterable
in interface IterableX<T>
unitIterable
in interface Traversable<T>
unitIterable
in interface ImmutableSet<T>
unitIterable
in interface ImmutableSortedSet<T>
public ReactiveSeq<T> stream()
stream
in interface Folds<T>
stream
in interface PersistentCollection<T>
stream
in interface PersistentSet<T>
stream
in interface IterableX<T>
stream
in interface Traversable<T>
stream
in interface ImmutableSet<T>
stream
in interface ImmutableSortedSet<T>
public static <T> TreeSet<T> of(java.util.Comparator<? super T> comp, T... values)
public static <T extends java.lang.Comparable<? super T>> TreeSet<T> of(T... values)
public static <T> TreeSet<T> fromSortedSet(java.util.SortedSet<T> set, java.util.Comparator<? super T> comp)
public boolean containsValue(T value)
containsValue
in interface PersistentCollection<T>
containsValue
in interface IterableX<T>
containsValue
in interface ImmutableSet<T>
public int size()
size
in interface PersistentCollection<T>
size
in interface IterableX<T>
size
in interface ImmutableSet<T>
public TreeSet<T> add(T value)
add
in interface ImmutableSet<T>
add
in interface ImmutableSortedSet<T>
public TreeSet<T> removeValue(T value)
removeValue
in interface PersistentCollection<T>
removeValue
in interface PersistentSet<T>
removeValue
in interface PersistentSortedSet<T>
removeValue
in interface IterableX<T>
removeValue
in interface ImmutableSet<T>
removeValue
in interface ImmutableSortedSet<T>
public boolean isEmpty()
isEmpty
in interface PersistentCollection<T>
isEmpty
in interface IterableX<T>
isEmpty
in interface ImmutableSet<T>
public <R> TreeSet<R> map(java.util.function.Function<? super T,? extends R> fn)
Transformable
of(1,2,3).map(i->i*2)
//[2,4,6]
map
in interface FilterableTransformable<T>
map
in interface Transformable<T>
map
in interface IterableX<T>
map
in interface Traversable<T>
map
in interface ImmutableSet<T>
map
in interface ImmutableSortedSet<T>
fn
- Transformation functionpublic <R> TreeSet<R> map(java.util.function.Function<? super T,? extends R> fn, java.util.Comparator<? super R> comp)
public <R> TreeSet<R> flatMap(java.util.function.Function<? super T,? extends ImmutableSet<? extends R>> fn)
flatMap
in interface ImmutableSet<T>
flatMap
in interface ImmutableSortedSet<T>
public <R> TreeSet<R> flatMap(java.util.function.Function<? super T,? extends ImmutableSet<? extends R>> fn, java.util.Comparator<? super R> comp)
public <R> TreeSet<R> concatMap(java.util.function.Function<? super T,? extends java.lang.Iterable<? extends R>> fn)
IterableX
concatMap
in interface IterableX<T>
concatMap
in interface ImmutableSet<T>
concatMap
in interface ImmutableSortedSet<T>
fn
- Transformation function to be applied (and flattened)public <R> TreeSet<R> mergeMap(java.util.function.Function<? super T,? extends org.reactivestreams.Publisher<? extends R>> fn)
mergeMap
in interface IterableX<T>
mergeMap
in interface ImmutableSet<T>
mergeMap
in interface ImmutableSortedSet<T>
public <R> TreeSet<R> mergeMap(int maxConcurecy, java.util.function.Function<? super T,? extends org.reactivestreams.Publisher<? extends R>> fn)
mergeMap
in interface IterableX<T>
mergeMap
in interface ImmutableSet<T>
mergeMap
in interface ImmutableSortedSet<T>
public <R> TreeSet<R> concatMap(java.util.function.Function<? super T,? extends java.lang.Iterable<? extends R>> fn, java.util.Comparator<? super R> comp)
public TreeSet<T> filter(java.util.function.Predicate<? super T> predicate)
Filters
of(1,2,3).filter(i->i>2);
//[3]
filter
in interface Filters<T>
filter
in interface FilterableTransformable<T>
filter
in interface IterableX<T>
filter
in interface ImmutableSet<T>
filter
in interface ImmutableSortedSet<T>
predicate
- to filter elements by, retaining matchespublic <R> TreeSet<R> unitStream(java.util.stream.Stream<R> stream)
unitStream
in interface ImmutableSet<T>
unitStream
in interface ImmutableSortedSet<T>
public ImmutableSortedSet<T> unitStream(java.util.stream.Stream<T> stream, java.util.Comparator<? super T> comp)
unitStream
in interface ImmutableSortedSet<T>
public TreeSet<T> plus(T value)
plus
in interface PersistentCollection<T>
plus
in interface PersistentSet<T>
plus
in interface PersistentSortedSet<T>
plus
in interface IterableX<T>
plus
in interface ImmutableSet<T>
plus
in interface ImmutableSortedSet<T>
public TreeSet<T> plusAll(java.lang.Iterable<? extends T> list)
plusAll
in interface PersistentCollection<T>
plusAll
in interface PersistentSet<T>
plusAll
in interface PersistentSortedSet<T>
plusAll
in interface IterableX<T>
plusAll
in interface ImmutableSet<T>
plusAll
in interface ImmutableSortedSet<T>
public TreeSet<T> removeAll(java.lang.Iterable<? extends T> list)
IterableFilterable
removeAll
in interface PersistentCollection<T>
removeAll
in interface PersistentSet<T>
removeAll
in interface PersistentSortedSet<T>
removeAll
in interface IterableFilterable<T>
removeAll
in interface IterableX<T>
removeAll
in interface ImmutableSet<T>
removeAll
in interface ImmutableSortedSet<T>
list
- an Iterable of elements to removeValuepublic Option<T> get(int index)
get
in interface PersistentSortedSet<T>
public java.util.Iterator<T> iterator()
iterator
in interface java.lang.Iterable<T>
public java.util.Comparator<? super T> comparator()
comparator
in interface PersistentSortedSet<T>
comparator
in interface ImmutableSortedSet<T>
public ImmutableSortedSet<T> subSet(T fromElement, T toElement)
subSet
in interface ImmutableSortedSet<T>
public Option<T> first()
first
in interface ImmutableSortedSet<T>
public Option<T> last()
last
in interface ImmutableSortedSet<T>
public ImmutableSortedSet<T> drop(int num)
drop
in interface ImmutableSortedSet<T>
public ImmutableSortedSet<T> take(int num)
take
in interface ImmutableSortedSet<T>
public java.lang.String printTree()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public TreeSet<T> take(long n)
Traversable
{@code ReactiveSeq.of(4,3,6,7) .take(2) .toList() asList(4,3)
take
in interface IterableX<T>
take
in interface Traversable<T>
take
in interface ImmutableSet<T>
take
in interface ImmutableSortedSet<T>
n
- Elements to takepublic TreeSet<T> takeWhile(java.util.function.Predicate<? super T> p)
Traversable
Seq.of(1,2,3).takeWhile(i<3);
//[1,2]
takeWhile
in interface IterableX<T>
takeWhile
in interface Traversable<T>
takeWhile
in interface ImmutableSet<T>
takeWhile
in interface ImmutableSortedSet<T>
p
- Predicate to determine when values should be takenpublic TreeSet<T> dropWhile(java.util.function.Predicate<? super T> p)
Traversable
Seq.of(1,2,3).dropWhile(i<3);
//[3]
dropWhile
in interface IterableX<T>
dropWhile
in interface Traversable<T>
dropWhile
in interface ImmutableSet<T>
dropWhile
in interface ImmutableSortedSet<T>
p
- Predicate to determine when values should be droppedpublic TreeSet<T> drop(long num)
Traversable
assertThat(ReactiveSeq.of(4,3,6,7).drop(2).toList(),equalTo(Arrays.asList(6,7)));
drop
in interface IterableX<T>
drop
in interface Traversable<T>
drop
in interface ImmutableSet<T>
drop
in interface ImmutableSortedSet<T>
num
- Number of elemenets to droppublic TreeSet<T> reverse()
reverse
in interface IterableX<T>
reverse
in interface Traversable<T>
reverse
in interface ImmutableSet<T>
reverse
in interface ImmutableSortedSet<T>
public <R1,R2> Tuple2<TreeSet<R1>,TreeSet<R2>> unzip(java.util.function.Function<? super T,Tuple2<? extends R1,? extends R2>> fn)
public TreeSet<T> removeFirst(java.util.function.Predicate<? super T> pred)
removeFirst
in interface IterableX<T>
removeFirst
in interface Traversable<T>
removeFirst
in interface ImmutableSet<T>
public TreeSet<T> append(T append)
append
in interface IterableX<T>
append
in interface Traversable<T>
append
in interface ImmutableSet<T>
append
in interface ImmutableSortedSet<T>
public TreeSet<T> appendAll(java.lang.Iterable<? extends T> it)
appendAll
in interface IterableX<T>
appendAll
in interface Traversable<T>
appendAll
in interface ImmutableSet<T>
public <R> R foldLeft(R zero, java.util.function.BiFunction<R,? super T,R> f)
public <U> TreeSet<U> ofType(java.lang.Class<? extends U> type)
Filters
// (1, 2, 3) ReactiveSeq.of(1, "a", 2, "b",3).ofType(Integer.class)
public TreeSet<T> filterNot(java.util.function.Predicate<? super T> predicate)
Filters
of(1,2,3).filter(i->i>2);
//[1,2]
filterNot
in interface Filters<T>
filterNot
in interface IterableX<T>
filterNot
in interface Traversable<T>
filterNot
in interface ImmutableSet<T>
filterNot
in interface ImmutableSortedSet<T>
predicate
- to filter elements by, retaining matchespublic TreeSet<T> notNull()
Filters
of(1,2,null,4).nonNull();
//[1,2,4]
public TreeSet<T> peek(java.util.function.Consumer<? super T> c)
Transformable
of(1,2,3).map(System.out::println)
1
2
3
peek
in interface Transformable<T>
peek
in interface IterableX<T>
peek
in interface ImmutableSet<T>
peek
in interface ImmutableSortedSet<T>
c
- Consumer that recieves each element from this Transformablepublic TreeSet<T> removeStream(java.util.stream.Stream<? extends T> stream)
IterableFilterable
removeStream
in interface IterableFilterable<T>
removeStream
in interface IterableX<T>
removeStream
in interface ImmutableSet<T>
removeStream
in interface ImmutableSortedSet<T>
stream
- of elements to removepublic TreeSet<T> retainAll(java.lang.Iterable<? extends T> it)
IterableFilterable
retainAll
in interface IterableFilterable<T>
retainAll
in interface IterableX<T>
retainAll
in interface ImmutableSet<T>
retainAll
in interface ImmutableSortedSet<T>
it
- Iterable of elements to retainpublic TreeSet<T> retainStream(java.util.stream.Stream<? extends T> stream)
IterableFilterable
retainStream
in interface IterableFilterable<T>
retainStream
in interface IterableX<T>
retainStream
in interface ImmutableSet<T>
retainStream
in interface ImmutableSortedSet<T>
stream
- of elements to retainpublic TreeSet<T> retainAll(T... values)
IterableFilterable
retainAll
in interface IterableFilterable<T>
retainAll
in interface IterableX<T>
retainAll
in interface ImmutableSet<T>
retainAll
in interface ImmutableSortedSet<T>
values
- elements to retainpublic TreeSet<ReactiveSeq<T>> permutations()
permutations
in interface IterableX<T>
permutations
in interface ImmutableSet<T>
permutations
in interface ImmutableSortedSet<T>
public TreeSet<ReactiveSeq<T>> combinations(int size)
combinations
in interface IterableX<T>
combinations
in interface ImmutableSet<T>
combinations
in interface ImmutableSortedSet<T>
public TreeSet<ReactiveSeq<T>> combinations()
combinations
in interface IterableX<T>
combinations
in interface ImmutableSet<T>
combinations
in interface ImmutableSortedSet<T>
public <T2,R> TreeSet<R> zip(java.util.function.BiFunction<? super T,? super T2,? extends R> fn, org.reactivestreams.Publisher<? extends T2> publisher)
Zippable
zip
in interface IterableX<T>
zip
in interface Traversable<T>
zip
in interface Zippable<T>
zip
in interface ImmutableSet<T>
zip
in interface ImmutableSortedSet<T>
fn
- Zip / combining functionpublisher
- to combine withpublic <U,R> TreeSet<R> zipWithStream(java.util.stream.Stream<? extends U> other, java.util.function.BiFunction<? super T,? super U,? extends R> zipper)
zipWithStream
in interface IterableX<T>
zipWithStream
in interface Traversable<T>
zipWithStream
in interface ImmutableSet<T>
zipWithStream
in interface ImmutableSortedSet<T>
public <U> TreeSet<Tuple2<T,U>> zipWithPublisher(org.reactivestreams.Publisher<? extends U> other)
zipWithPublisher
in interface IterableX<T>
zipWithPublisher
in interface Traversable<T>
zipWithPublisher
in interface Zippable<T>
zipWithPublisher
in interface ImmutableSet<T>
zipWithPublisher
in interface ImmutableSortedSet<T>
public <U> TreeSet<Tuple2<T,U>> zip(java.lang.Iterable<? extends U> other)
zip
in interface IterableX<T>
zip
in interface Traversable<T>
zip
in interface Zippable<T>
zip
in interface ImmutableSet<T>
zip
in interface ImmutableSortedSet<T>
public <S,U,R> TreeSet<R> zip3(java.lang.Iterable<? extends S> second, java.lang.Iterable<? extends U> third, Function3<? super T,? super S,? super U,? extends R> fn3)
zip3
in interface IterableX<T>
zip3
in interface Traversable<T>
zip3
in interface Zippable<T>
zip3
in interface ImmutableSet<T>
zip3
in interface ImmutableSortedSet<T>
public <T2,T3,T4,R> TreeSet<R> zip4(java.lang.Iterable<? extends T2> second, java.lang.Iterable<? extends T3> third, java.lang.Iterable<? extends T4> fourth, Function4<? super T,? super T2,? super T3,? super T4,? extends R> fn)
zip4
in interface IterableX<T>
zip4
in interface Traversable<T>
zip4
in interface Zippable<T>
zip4
in interface ImmutableSet<T>
zip4
in interface ImmutableSortedSet<T>
public TreeSet<T> combine(java.util.function.BiPredicate<? super T,? super T> predicate, java.util.function.BinaryOperator<T> op)
Traversable
ReactiveSeq.of(1,1,2,3)
.combine((a, b)->a.equals(b),SemigroupK.intSum)
.listX()
//Seq(3,4)
Can be used to implement terminating lazy folds on lazy data types
ReactiveSeq.generate(this::process)
.map(data->data.isSuccess())
.combine((a,b)-> a ? false : true, (a,b) -> a|b)
.findFirst(); //terminating reduction on infinite data structure
combine
in interface IterableX<T>
combine
in interface Traversable<T>
combine
in interface ImmutableSet<T>
combine
in interface ImmutableSortedSet<T>
predicate
- Test to see if two neighbours should be joined. The first parameter to the bi-predicate is the currently
accumulated result and the second is the next elementop
- BinaryOperator to combine neighbourspublic TreeSet<T> combine(Monoid<T> op, java.util.function.BiPredicate<? super T,? super T> predicate)
Traversable
ReactiveSeq.of(1,1,2,3)
.combine(Monoids.intMult,(a, b)->a.equals(b))
.listX()
//Seq(1)
Simalar to @see Traversable.combine(BiPredicate, BinaryOperator)
but differs in that the first comparison is always to the Monoid zero
This allows us to terminate with just a single valuecombine
in interface IterableX<T>
combine
in interface Traversable<T>
combine
in interface ImmutableSet<T>
combine
in interface ImmutableSortedSet<T>
op
- Monoid to combine neighbourspredicate
- Test to see if two neighbours should be joined. The first parameter to the bi-predicate is the currently
accumulated result and the second is the next elementpublic TreeSet<T> cycle(long times)
cycle
in interface IterableX<T>
cycle
in interface Traversable<T>
cycle
in interface ImmutableSet<T>
cycle
in interface ImmutableSortedSet<T>
public TreeSet<T> cycle(Monoid<T> m, long times)
cycle
in interface IterableX<T>
cycle
in interface Traversable<T>
cycle
in interface ImmutableSet<T>
cycle
in interface ImmutableSortedSet<T>
public TreeSet<T> cycleWhile(java.util.function.Predicate<? super T> predicate)
cycleWhile
in interface IterableX<T>
cycleWhile
in interface Traversable<T>
cycleWhile
in interface ImmutableSet<T>
cycleWhile
in interface ImmutableSortedSet<T>
public TreeSet<T> cycleUntil(java.util.function.Predicate<? super T> predicate)
cycleUntil
in interface IterableX<T>
cycleUntil
in interface Traversable<T>
cycleUntil
in interface ImmutableSet<T>
cycleUntil
in interface ImmutableSortedSet<T>
public <U,R> TreeSet<R> zip(java.lang.Iterable<? extends U> other, java.util.function.BiFunction<? super T,? super U,? extends R> zipper)
Zippable
zip
in interface IterableX<T>
zip
in interface Traversable<T>
zip
in interface Zippable<T>
zip
in interface ImmutableSet<T>
zip
in interface ImmutableSortedSet<T>
other
- to zip withzipper
- Zip functionpublic <S,U> TreeSet<Tuple3<T,S,U>> zip3(java.lang.Iterable<? extends S> second, java.lang.Iterable<? extends U> third)
zip3
in interface IterableX<T>
zip3
in interface Traversable<T>
zip3
in interface Zippable<T>
zip3
in interface ImmutableSet<T>
zip3
in interface ImmutableSortedSet<T>
public <T2,T3,T4> TreeSet<Tuple4<T,T2,T3,T4>> zip4(java.lang.Iterable<? extends T2> second, java.lang.Iterable<? extends T3> third, java.lang.Iterable<? extends T4> fourth)
zip4
in interface IterableX<T>
zip4
in interface Traversable<T>
zip4
in interface Zippable<T>
zip4
in interface ImmutableSet<T>
zip4
in interface ImmutableSortedSet<T>
public TreeSet<Tuple2<T,java.lang.Long>> zipWithIndex()
zipWithIndex
in interface IterableX<T>
zipWithIndex
in interface Traversable<T>
zipWithIndex
in interface ImmutableSet<T>
zipWithIndex
in interface ImmutableSortedSet<T>
public TreeSet<Seq<T>> sliding(int windowSize)
Traversable
sliding
in interface IterableX<T>
sliding
in interface Traversable<T>
sliding
in interface ImmutableSet<T>
sliding
in interface ImmutableSortedSet<T>
public TreeSet<Seq<T>> sliding(int windowSize, int increment)
Traversable
sliding
in interface IterableX<T>
sliding
in interface Traversable<T>
sliding
in interface ImmutableSet<T>
sliding
in interface ImmutableSortedSet<T>
public <C extends PersistentCollection<? super T>> TreeSet<C> grouped(int size, java.util.function.Supplier<C> supplier)
Traversable
ReactiveSeq.of(1,1,1,1,1,1)
.grouped(3,()->new TreeSet<>())
.toList()
.getValue(0)
.size();
//1
ReactiveSeq.of(1,2,3,4,5,6)
.grouped(3,()->new TreeSet<>())
.toList()
.getValue(0)
.size();
//3
grouped
in interface IterableX<T>
grouped
in interface Traversable<T>
grouped
in interface ImmutableSet<T>
grouped
in interface ImmutableSortedSet<T>
size
- batch sizesupplier
- Collection factorypublic TreeSet<Vector<T>> groupedUntil(java.util.function.Predicate<? super T> predicate)
Traversable
ReactiveSeq.of(1,2,3,4,5,6)
.groupedUntil(i->i%3==0)
.toList()
.size();
//2
groupedUntil
in interface IterableX<T>
groupedUntil
in interface Traversable<T>
groupedUntil
in interface ImmutableSet<T>
groupedUntil
in interface ImmutableSortedSet<T>
predicate
- group until predicate holdspublic TreeSet<Vector<T>> groupedUntil(java.util.function.BiPredicate<Vector<? super T>,? super T> predicate)
Traversable
assertThat(ReactiveSeq.of(1,2,3,4,5,6)
.groupedUntil((s,i)->s.contains(4) ? true : false)
.toList().size(),equalTo(5));
groupedUntil
in interface IterableX<T>
groupedUntil
in interface Traversable<T>
groupedUntil
in interface ImmutableSet<T>
groupedUntil
in interface ImmutableSortedSet<T>
predicate
- Window while truepublic <U> TreeSet<Tuple2<T,U>> zipWithStream(java.util.stream.Stream<? extends U> other)
zipWithStream
in interface IterableX<T>
zipWithStream
in interface Traversable<T>
zipWithStream
in interface ImmutableSet<T>
zipWithStream
in interface ImmutableSortedSet<T>
public TreeSet<Vector<T>> groupedWhile(java.util.function.Predicate<? super T> predicate)
Traversable
assertThat(ReactiveSeq.of(1,2,3,4,5,6)
.groupedWhile(i->i%3!=0)
.toList().size(),equalTo(2));
groupedWhile
in interface IterableX<T>
groupedWhile
in interface Traversable<T>
groupedWhile
in interface ImmutableSet<T>
groupedWhile
in interface ImmutableSortedSet<T>
predicate
- Batch while predicate holds, applyHKT open next batchpublic <C extends PersistentCollection<? super T>> TreeSet<C> groupedWhile(java.util.function.Predicate<? super T> predicate, java.util.function.Supplier<C> factory)
Traversable
assertThat(ReactiveSeq.of(1,2,3,4,5,6)
.groupedWhile(i->i%3!=0)
.toList()
.size(),equalTo(2));
groupedWhile
in interface IterableX<T>
groupedWhile
in interface Traversable<T>
groupedWhile
in interface ImmutableSet<T>
groupedWhile
in interface ImmutableSortedSet<T>
predicate
- Batch while predicate holds, applyHKT open next batchfactory
- Collection factorypublic <C extends PersistentCollection<? super T>> TreeSet<C> groupedUntil(java.util.function.Predicate<? super T> predicate, java.util.function.Supplier<C> factory)
Traversable
ReactiveSeq.of(1,2,3,4,5,6)
.groupedUntil(i->i%3!=0)
.toList()
//2
groupedUntil
in interface IterableX<T>
groupedUntil
in interface Traversable<T>
groupedUntil
in interface ImmutableSet<T>
groupedUntil
in interface ImmutableSortedSet<T>
predicate
- Batch until predicate holds, applyHKT open next batchfactory
- Collection factorypublic TreeSet<Vector<T>> grouped(int groupSize)
Traversable
List<List<Integer>> list = ReactiveSeq.of(1, 2, 3, 4, 5, 6).grouped(3).collect(CyclopsCollectors.toList());
assertThat(list.getValue(0), hasItems(1, 2, 3));
assertThat(list.getValue(1), hasItems(4, 5, 6));
grouped
in interface IterableX<T>
grouped
in interface Traversable<T>
grouped
in interface ImmutableSet<T>
grouped
in interface ImmutableSortedSet<T>
groupSize
- Size of each Grouppublic TreeSet<T> distinct()
distinct
in interface IterableX<T>
distinct
in interface Traversable<T>
distinct
in interface ImmutableSet<T>
distinct
in interface ImmutableSortedSet<T>
public TreeSet<T> scanLeft(Monoid<T> monoid)
Traversable
{@code ReactiveSeq.of("a", "b", "c") .scanLeft(Reducers.toString("")) .toList(); //asList("", "a", "ab", "abc")
scanLeft
in interface IterableX<T>
scanLeft
in interface Traversable<T>
scanLeft
in interface ImmutableSet<T>
scanLeft
in interface ImmutableSortedSet<T>
public <U> TreeSet<U> scanLeft(U seed, java.util.function.BiFunction<? super U,? super T,? extends U> function)
Traversable
ReactiveSeq.of("a", "b", "c")
.scanLeft("", String::concat)
.toList();
//[, a, ab, abc]
scanLeft
in interface IterableX<T>
scanLeft
in interface Traversable<T>
scanLeft
in interface ImmutableSet<T>
scanLeft
in interface ImmutableSortedSet<T>
public TreeSet<T> scanRight(Monoid<T> monoid)
Traversable
ReactiveSeq.of("a", "b", "c")
.scanRight(Monoid.of("", String::concat))
.toList()
//asList("", "c", "bc", "abc")
scanRight
in interface IterableX<T>
scanRight
in interface Traversable<T>
scanRight
in interface ImmutableSet<T>
scanRight
in interface ImmutableSortedSet<T>
public <U> TreeSet<U> scanRight(U identity, java.util.function.BiFunction<? super T,? super U,? extends U> combiner)
Traversable
ReactiveSeq.of("a", "ab", "abc")
.map(str->str.length())
.scanRight(0, (t, u) -> u + t)
.toList();
//asList(0, 3, 5, 6);
scanRight
in interface IterableX<T>
scanRight
in interface Traversable<T>
scanRight
in interface ImmutableSet<T>
scanRight
in interface ImmutableSortedSet<T>
public TreeSet<T> sorted()
Traversable
{@code ReactiveSeq.of(4,3,6,7)) .sorted() .toList() //Arrays.asList(3,4,6,7)
sorted
in interface IterableX<T>
sorted
in interface Traversable<T>
sorted
in interface ImmutableSet<T>
sorted
in interface ImmutableSortedSet<T>
public TreeSet<T> sorted(java.util.Comparator<? super T> c)
Traversable
assertThat(ReactiveSeq.of(4,3,6,7).sorted((a,b) -> b-a).toList(),equalTo(Arrays.asList(7,6,4,3)));
sorted
in interface IterableX<T>
sorted
in interface Traversable<T>
sorted
in interface ImmutableSet<T>
sorted
in interface ImmutableSortedSet<T>
c
- Compartor to sort withpublic TreeSet<T> takeUntil(java.util.function.Predicate<? super T> p)
Traversable
Seq.of(1,2,3).takeUntil(i<2);
//[1,2]
takeUntil
in interface IterableX<T>
takeUntil
in interface Traversable<T>
takeUntil
in interface ImmutableSet<T>
takeUntil
in interface ImmutableSortedSet<T>
p
- Predicate to determine when values should be taken untilpublic TreeSet<T> dropUntil(java.util.function.Predicate<? super T> p)
Traversable
Seq.of(1,2,3).dropUntil(i>2);
//[3]
dropUntil
in interface IterableX<T>
dropUntil
in interface Traversable<T>
dropUntil
in interface ImmutableSet<T>
dropUntil
in interface ImmutableSortedSet<T>
p
- Predicate to determine when values should be droppedpublic TreeSet<T> dropRight(int num)
Traversable
Seq.of(1,2,3).dropRight(2);
//[1]
dropRight
in interface IterableX<T>
dropRight
in interface Traversable<T>
dropRight
in interface ImmutableSet<T>
dropRight
in interface ImmutableSortedSet<T>
num
- Drop this number of elements from the take of this Traversablepublic TreeSet<T> takeRight(int num)
Traversable
Seq.of(1,2,3).takeRight(2);
//[2,3]
takeRight
in interface IterableX<T>
takeRight
in interface Traversable<T>
takeRight
in interface ImmutableSet<T>
takeRight
in interface ImmutableSortedSet<T>
num
- Take this number of elements from the take of this Traversablepublic TreeSet<T> intersperse(T value)
Traversable
ReactiveSeq.of(1, 2, 3, 4).intersperse(0)
// (1, 0, 2, 0, 3, 0, 4)
intersperse
in interface IterableX<T>
intersperse
in interface Traversable<T>
intersperse
in interface ImmutableSet<T>
intersperse
in interface ImmutableSortedSet<T>
public TreeSet<T> shuffle()
shuffle
in interface IterableX<T>
shuffle
in interface Traversable<T>
shuffle
in interface ImmutableSet<T>
shuffle
in interface ImmutableSortedSet<T>
public TreeSet<T> shuffle(java.util.Random random)
shuffle
in interface IterableX<T>
shuffle
in interface Traversable<T>
shuffle
in interface ImmutableSet<T>
shuffle
in interface ImmutableSortedSet<T>
public TreeSet<T> slice(long from, long to)
slice
in interface IterableX<T>
slice
in interface Traversable<T>
slice
in interface ImmutableSet<T>
slice
in interface ImmutableSortedSet<T>
public TreeSet<T> prependStream(java.util.stream.Stream<? extends T> stream)
prependStream
in interface IterableX<T>
prependStream
in interface Traversable<T>
prependStream
in interface ImmutableSet<T>
prependStream
in interface ImmutableSortedSet<T>
public TreeSet<T> appendAll(T... values)
appendAll
in interface IterableX<T>
appendAll
in interface Traversable<T>
appendAll
in interface ImmutableSet<T>
appendAll
in interface ImmutableSortedSet<T>
public TreeSet<T> prependAll(T... values)
Traversable
List<String> result = ReactiveSeq.of(1,2,3)
.prependAll(100,200,300)
.map(it ->it+"!!")
.collect(CyclopsCollectors.toList());
//asList("100!!","200!!","300!!","1!!","2!!","3!!")));
prependAll
in interface IterableX<T>
prependAll
in interface Traversable<T>
prependAll
in interface ImmutableSet<T>
prependAll
in interface ImmutableSortedSet<T>
values
- to prependAllpublic TreeSet<T> deleteBetween(int start, int end)
Traversable
{@code Listresult = ReactiveSeq.of(1, 2, 3, 4, 5, 6) .deleteBetween(2, 4).map(it -> it + "!!") .collect(CyclopsCollectors.toList()); //Arrays.asList("1!!", "2!!", "5!!", "6!!")));
deleteBetween
in interface IterableX<T>
deleteBetween
in interface Traversable<T>
deleteBetween
in interface ImmutableSet<T>
deleteBetween
in interface ImmutableSortedSet<T>
start
- indexend
- indexpublic TreeSet<T> insertStreamAt(int pos, java.util.stream.Stream<T> stream)
Traversable
List<String> result = ReactiveSeq.of(1, 2, 3)
.insertAt(1, of(100, 200, 300))
.map(it -> it + "!!")
.collect(CyclopsCollectors.toList());
//Arrays.asList("1!!", "100!!", "200!!", "300!!", "2!!", "3!!")));
insertStreamAt
in interface IterableX<T>
insertStreamAt
in interface Traversable<T>
insertStreamAt
in interface ImmutableSet<T>
insertStreamAt
in interface ImmutableSortedSet<T>
pos
- to insert Stream atstream
- to insertpublic <U extends java.lang.Comparable<? super U>> TreeSet<T> sorted(java.util.function.Function<? super T,? extends U> function)
sorted
in interface IterableX<T>
sorted
in interface Traversable<T>
sorted
in interface ImmutableSet<T>
sorted
in interface ImmutableSortedSet<T>
public java.lang.String mkString()
public TreeSet<T> onEmpty(T value)
OnEmpty
onEmpty
in interface OnEmpty<T>
onEmpty
in interface IterableX<T>
onEmpty
in interface Traversable<T>
onEmpty
in interface ImmutableSet<T>
onEmpty
in interface ImmutableSortedSet<T>
public TreeSet<T> onEmptyGet(java.util.function.Supplier<? extends T> supplier)
OnEmpty
onEmptyGet
in interface OnEmpty<T>
onEmptyGet
in interface IterableX<T>
onEmptyGet
in interface Traversable<T>
onEmptyGet
in interface ImmutableSet<T>
onEmptyGet
in interface ImmutableSortedSet<T>
supplier
- to determine new value for containerpublic TreeSet<T> removeAll(T... values)
IterableFilterable
removeAll
in interface IterableFilterable<T>
removeAll
in interface IterableX<T>
removeAll
in interface ImmutableSet<T>
removeAll
in interface ImmutableSortedSet<T>
values
- to removeValuepublic TreeSet<T> prepend(T value)
prepend
in interface IterableX<T>
prepend
in interface Traversable<T>
prepend
in interface ImmutableSet<T>
prepend
in interface ImmutableSortedSet<T>
public TreeSet<T> removeAt(long pos)
removeAt
in interface IterableX<T>
removeAt
in interface Traversable<T>
removeAt
in interface ImmutableSet<T>
public TreeSet<T> prependAll(java.lang.Iterable<? extends T> value)
prependAll
in interface IterableX<T>
prependAll
in interface Traversable<T>
prependAll
in interface ImmutableSet<T>
public <R1,R2,R3,R> TreeSet<R> forEach4(java.util.function.Function<? super T,? extends java.lang.Iterable<R1>> iterable1, java.util.function.BiFunction<? super T,? super R1,? extends java.lang.Iterable<R2>> iterable2, Function3<? super T,? super R1,? super R2,? extends java.lang.Iterable<R3>> iterable3, Function4<? super T,? super R1,? super R2,? super R3,? extends R> yieldingFunction)
forEach4
in interface ImmutableSet<T>
forEach4
in interface ImmutableSortedSet<T>
public <R1,R2,R3,R> TreeSet<R> forEach4(java.util.function.Function<? super T,? extends java.lang.Iterable<R1>> iterable1, java.util.function.BiFunction<? super T,? super R1,? extends java.lang.Iterable<R2>> iterable2, Function3<? super T,? super R1,? super R2,? extends java.lang.Iterable<R3>> iterable3, Function4<? super T,? super R1,? super R2,? super R3,java.lang.Boolean> filterFunction, Function4<? super T,? super R1,? super R2,? super R3,? extends R> yieldingFunction)
forEach4
in interface ImmutableSet<T>
forEach4
in interface ImmutableSortedSet<T>
public <R1,R2,R> TreeSet<R> forEach3(java.util.function.Function<? super T,? extends java.lang.Iterable<R1>> iterable1, java.util.function.BiFunction<? super T,? super R1,? extends java.lang.Iterable<R2>> iterable2, Function3<? super T,? super R1,? super R2,? extends R> yieldingFunction)
forEach3
in interface ImmutableSet<T>
forEach3
in interface ImmutableSortedSet<T>
public <R1,R2,R> TreeSet<R> forEach3(java.util.function.Function<? super T,? extends java.lang.Iterable<R1>> iterable1, java.util.function.BiFunction<? super T,? super R1,? extends java.lang.Iterable<R2>> iterable2, Function3<? super T,? super R1,? super R2,java.lang.Boolean> filterFunction, Function3<? super T,? super R1,? super R2,? extends R> yieldingFunction)
forEach3
in interface ImmutableSet<T>
forEach3
in interface ImmutableSortedSet<T>
public <R1,R> TreeSet<R> forEach2(java.util.function.Function<? super T,? extends java.lang.Iterable<R1>> iterable1, java.util.function.BiFunction<? super T,? super R1,? extends R> yieldingFunction)
forEach2
in interface ImmutableSet<T>
forEach2
in interface ImmutableSortedSet<T>
public <R1,R> TreeSet<R> forEach2(java.util.function.Function<? super T,? extends java.lang.Iterable<R1>> iterable1, java.util.function.BiFunction<? super T,? super R1,java.lang.Boolean> filterFunction, java.util.function.BiFunction<? super T,? super R1,? extends R> yieldingFunction)
forEach2
in interface ImmutableSet<T>
forEach2
in interface ImmutableSortedSet<T>
public TreeSet<T> updateAt(int pos, T value)
updateAt
in interface IterableX<T>
updateAt
in interface Traversable<T>
updateAt
in interface ImmutableSet<T>
public TreeSet<T> insertAt(int pos, java.lang.Iterable<? extends T> values)
insertAt
in interface IterableX<T>
insertAt
in interface Traversable<T>
insertAt
in interface ImmutableSet<T>
public TreeSet<T> insertAt(int pos, T... values)
Traversable
List<String> result = ReactiveSeq.of(1, 2, 3)
.insertAt(1, 100, 200, 300)
.map(it -> it + "!!")
.collect(CyclopsCollectors.toList());
//Arrays.asList("1!!", "100!!", "200!!", "300!!", "2!!", "3!!")))
insertAt
in interface IterableX<T>
insertAt
in interface Traversable<T>
insertAt
in interface ImmutableSet<T>
insertAt
in interface ImmutableSortedSet<T>
pos
- to insert data atvalues
- to insert