public static class LazySeq.Cons<T> extends java.lang.Object implements LazySeq<T>, ImmutableList.Some<T>
LazySeq.Cons<T>, LazySeq.Lazy<T>, LazySeq.Nil<T>
Deconstruct.Deconstruct1<T1>, Deconstruct.Deconstruct2<T1,T2>, Deconstruct.Deconstruct3<T1,T2,T3>, Deconstruct.Deconstruct4<T1,T2,T3,T4>, Deconstruct.Deconstruct5<T1,T2,T3,T4,T5>
ImmutableList.None<T>, ImmutableList.Some<T>
Modifier and Type | Field and Description |
---|---|
Eval<T> |
head |
java.util.function.Supplier<LazySeq<T>> |
tail |
Constructor and Description |
---|
Cons() |
Modifier and Type | Method and Description |
---|---|
LazySeq.Cons<T> |
append(java.util.function.Supplier<LazySeq<T>> list) |
<R> LazySeq<R> |
concatMap(java.util.function.Function<? super T,? extends java.lang.Iterable<? extends R>> fn)
Perform a flatMap operation on this IterableX.
|
static <T> LazySeq.Cons<T> |
cons(Eval<T> value,
java.util.function.Supplier<LazySeq<T>> tail) |
LazySeq.Cons<T> |
cycle() |
boolean |
equals(java.lang.Object obj) |
LazySeq<T> |
filter(java.util.function.Predicate<? super T> pred)
Keep only elements for which the supplied predicates hold
e.g.
|
<R> LazySeq<R> |
flatMap(java.util.function.Function<? super T,? extends ImmutableList<? extends R>> fn) |
<R> R |
fold(java.util.function.Function<? super ImmutableList.Some<T>,? extends R> fn1,
java.util.function.Function<? super ImmutableList.None<T>,? extends R> fn2) |
<R> R |
foldLazySeq(java.util.function.Function<? super LazySeq.Cons<T>,? extends R> fn1,
java.util.function.Function<? super LazySeq.Nil,? extends R> fn2) |
T |
foldRight(Monoid<T> reducer)
ReactiveSeq.of("a","b","c").foldRight(Reducers.toString(""));
// "cab"
|
int |
hashCode() |
T |
head() |
LazySeq<T> |
insertAt(int i,
java.lang.Iterable<? extends T> list) |
LazySeq<T> |
insertAt(int i,
T value) |
boolean |
isEmpty() |
<R> R |
lazyFoldRight(R zero,
java.util.function.BiFunction<? super T,java.util.function.Supplier<R>,? extends R> f) |
<R> LazySeq<R> |
map(java.util.function.Function<? super T,? extends R> fn)
Transform this functor using the supplied transformation function
|
<R> LazySeq<R> |
mergeMap(java.util.function.Function<? super T,? extends org.reactivestreams.Publisher<? extends R>> fn) |
<R> LazySeq<R> |
mergeMap(int maxConcurecy,
java.util.function.Function<? super T,? extends org.reactivestreams.Publisher<? extends R>> fn) |
LazySeq.Cons<T> |
onEmpty(T value)
If this Container instance is zero, create a new instance containing the provided value
|
LazySeq.Cons<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
|
LazySeq.Cons<T> |
onEmptySwitch(java.util.function.Supplier<? extends ImmutableList<T>> supplier)
Switch to container created by provided Supplier, if current Container zero
|
LazySeq<T> |
removeAt(long i) |
LazySeq<T> |
removeFirst(java.util.function.Predicate<? super T> e) |
LazySeq<T> |
removeValue(T e) |
LazySeq.Cons<T> |
reverse() |
int |
size() |
LazySeq<T> |
tail() |
java.lang.String |
toString() |
Tuple2<T,ImmutableList<T>> |
unapply() |
LazySeq<T> |
updateAt(int i,
T value) |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
append, appendAll, appendAll, collector, combinations, combinations, combine, combine, cons, containsValue, cycle, cycle, cycleUntil, cycleWhile, defer, deferred, deleteBetween, distinct, drop, dropRight, dropUntil, dropWhile, duplicate, empty, emptyUnit, enums, enums, enums, enumsFromTo, fill, fill, filterNot, foldLeft, foldRight, foldRight, forEach2, forEach2, forEach3, forEach3, forEach4, forEach4, fromIterable, fromIterator, fromStream, generate, generate, generate, get, getOrElse, getOrElseGet, grouped, grouped, groupedUntil, groupedUntil, groupedUntil, groupedWhile, groupedWhile, headOrElse, headOrElseGet, insertAt, insertStreamAt, intersperse, iterate, iterate, iterate, iterator, lazy, mkString, narrow, narrowK, notNull, of, ofType, peek, permutations, plus, plusAll, prepend, prependAll, prependAll, prependStream, range, range, rangeLong, rangeLong, removeAll, removeAll, removeStream, replaceFirst, retainAll, retainAll, retainStream, scanLeft, scanLeft, scanRight, scanRight, shuffle, shuffle, slice, sliding, sliding, sorted, sorted, sorted, span, split, splitBy, stream, subList, tailOrElse, tailOrElseGet, tailRec, take, takeRight, takeUntil, takeWhile, unfold, unitIterable, unitStream, unzip, unzip, widen, widen2, zip, zip, zip, zip3, zip3, zip4, zip4, zipWithIndex, zipWithPublisher, zipWithStream, zipWithStream
fold
compareTo, equalToDirectAccess, focusAt, focusAt, fold, last, lazySeq, nonEmptyList, onEmptyTry, partition, seq, splitAt, tailOrElse, traversable
asFunction, equalToIteration, foldFuture, foldLazy, foldTry, forEach, forEach, forEach, forEach, forEach, forEachSubscribe, forEachSubscribe, forEachSubscribe, runFuture, runLazy, 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, groupBy, hashSet, headOption, indexOf, indexOfSlice, intStats, iterableTo, join, join, join, lastIndexOf, lastIndexOfSlice, 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
listView
public static <T> LazySeq.Cons<T> cons(Eval<T> value, java.util.function.Supplier<LazySeq<T>> tail)
public Tuple2<T,ImmutableList<T>> unapply()
unapply
in interface Deconstruct<Tuple2<T,ImmutableList<T>>>
public boolean isEmpty()
public T foldRight(Monoid<T> reducer)
Folds
ReactiveSeq.of("a","b","c").foldRight(Reducers.toString(""));
// "cab"
public <R> R lazyFoldRight(R zero, java.util.function.BiFunction<? super T,java.util.function.Supplier<R>,? extends R> f)
lazyFoldRight
in interface LazySeq<T>
public <R> LazySeq<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 ImmutableList<T>
map
in interface LazySeq<T>
fn
- Transformation functionpublic <R> LazySeq<R> flatMap(java.util.function.Function<? super T,? extends ImmutableList<? extends R>> fn)
public LazySeq<T> filter(java.util.function.Predicate<? super T> pred)
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 ImmutableList<T>
filter
in interface LazySeq<T>
pred
- to filter elements by, retaining matchespublic <R> LazySeq<R> mergeMap(java.util.function.Function<? super T,? extends org.reactivestreams.Publisher<? extends R>> fn)
public <R> LazySeq<R> mergeMap(int maxConcurecy, java.util.function.Function<? super T,? extends org.reactivestreams.Publisher<? extends R>> fn)
public <R> LazySeq<R> concatMap(java.util.function.Function<? super T,? extends java.lang.Iterable<? extends R>> fn)
IterableX
concatMap
in interface IterableX<T>
concatMap
in interface ImmutableList<T>
concatMap
in interface LazySeq<T>
fn
- Transformation function to be applied (and flattened)public LazySeq.Cons<T> cycle()
public LazySeq<T> removeValue(T e)
removeValue
in interface PersistentCollection<T>
removeValue
in interface PersistentList<T>
removeValue
in interface IterableX<T>
removeValue
in interface ImmutableList<T>
removeValue
in interface LazySeq<T>
public LazySeq<T> removeFirst(java.util.function.Predicate<? super T> e)
removeFirst
in interface IterableX<T>
removeFirst
in interface Traversable<T>
removeFirst
in interface ImmutableList<T>
removeFirst
in interface LazySeq<T>
public LazySeq<T> tail()
tail
in interface ImmutableList.Some<T>
public T head()
head
in interface ImmutableList.Some<T>
public int size()
public LazySeq.Cons<T> append(java.util.function.Supplier<LazySeq<T>> list)
public LazySeq.Cons<T> reverse()
reverse
in interface IterableX<T>
reverse
in interface Traversable<T>
reverse
in interface ImmutableList<T>
reverse
in interface ImmutableList.Some<T>
reverse
in interface LazySeq<T>
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public <R> R fold(java.util.function.Function<? super ImmutableList.Some<T>,? extends R> fn1, java.util.function.Function<? super ImmutableList.None<T>,? extends R> fn2)
fold
in interface Sealed2<ImmutableList.Some<T>,ImmutableList.None<T>>
fold
in interface ImmutableList<T>
fold
in interface ImmutableList.Some<T>
public LazySeq.Cons<T> onEmpty(T value)
OnEmpty
onEmpty
in interface OnEmpty<T>
onEmpty
in interface IterableX<T>
onEmpty
in interface Traversable<T>
onEmpty
in interface ImmutableList<T>
onEmpty
in interface LazySeq<T>
public LazySeq.Cons<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 ImmutableList<T>
onEmptyGet
in interface LazySeq<T>
supplier
- to determine new value for containerpublic LazySeq.Cons<T> onEmptySwitch(java.util.function.Supplier<? extends ImmutableList<T>> supplier)
OnEmptySwitch
Seq.zero().onEmptySwitch(()->Seq.of(1));
onEmptySwitch
in interface OnEmptySwitch<ImmutableList<T>,ImmutableList<T>>
onEmptySwitch
in interface ImmutableList<T>
onEmptySwitch
in interface LazySeq<T>
supplier
- to create replacement containerpublic <R> R foldLazySeq(java.util.function.Function<? super LazySeq.Cons<T>,? extends R> fn1, java.util.function.Function<? super LazySeq.Nil,? extends R> fn2)
foldLazySeq
in interface LazySeq<T>
public java.lang.String toString()
toString
in class java.lang.Object
public LazySeq<T> removeAt(long i)
removeAt
in interface PersistentList<T>
removeAt
in interface IterableX<T>
removeAt
in interface Traversable<T>
removeAt
in interface ImmutableList<T>
removeAt
in interface LazySeq<T>
public LazySeq<T> updateAt(int i, T value)
updateAt
in interface PersistentList<T>
updateAt
in interface IterableX<T>
updateAt
in interface Traversable<T>
updateAt
in interface ImmutableList<T>
updateAt
in interface LazySeq<T>
public LazySeq<T> insertAt(int i, java.lang.Iterable<? extends T> list)
insertAt
in interface PersistentList<T>
insertAt
in interface IterableX<T>
insertAt
in interface Traversable<T>
insertAt
in interface ImmutableList<T>
insertAt
in interface LazySeq<T>