T - the type of elements held in this toXpublic class LazyListX<T> extends AbstractLazyCollection<T,java.util.List<T>> implements ListX<T>
List
Extended List operations execute lazily e.g.
LazyListX<Integer> q = LazyListX.of(1,2,3)
.map(i->i*2);
The map operation above is not executed immediately. It will only be executed when (if) the data inside the
queue is accessed. This allows lazy operations to be chained and executed more efficiently e.g.
LazyListX<Integer> q = LazyListX.of(1,2,3)
.map(i->i*2);
.filter(i->i<5);
The operation above is more efficient than the equivalent operation with a ListX.ListX.CompletableListX<T>, ListX.Instances| Constructor and Description |
|---|
LazyListX(java.util.List<T> list,
ReactiveSeq<T> seq,
java.util.stream.Collector<T,?,java.util.List<T>> collector) |
LazyListX(java.util.List<T> list,
ReactiveSeq<T> seq,
java.util.stream.Collector<T,?,java.util.List<T>> collector,
Evaluation strict) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
T element) |
boolean |
addAll(int index,
java.util.Collection<? extends T> c) |
ListX<T> |
eager() |
<T1> LazyListX<T1> |
from(java.util.Collection<T1> c)
Conctruct an Extended Collection from a standard Collection
|
<X> LazyListX<X> |
fromStream(ReactiveSeq<X> stream) |
T |
get(int index) |
<T1> java.util.stream.Collector<T1,?,java.util.List<T1>> |
getCollector() |
int |
indexOf(java.lang.Object o) |
java.util.Iterator<T> |
iterator() |
int |
lastIndexOf(java.lang.Object o) |
ListX<T> |
lazy() |
java.util.ListIterator<T> |
listIterator() |
java.util.ListIterator<T> |
listIterator(int index) |
ListX<T> |
materialize() |
T |
remove(int index) |
void |
replaceAll(java.util.function.UnaryOperator<T> operator) |
T |
set(int index,
T element) |
void |
sort(java.util.Comparator<? super T> c) |
ListX<T> |
subList(int fromIndex,
int toIndex)
Create a sub sequence between the two supplied index
|
java.lang.String |
toString() |
ListX<T> |
type(java.util.stream.Collector<T,?,java.util.List<T>> collector) |
<R> LazyListX<R> |
unit(java.util.Collection<R> col)
Create a new instance of the same colleciton type from the supplied toX
|
<U> LazyListX<U> |
unitIterator(java.util.Iterator<U> it)
Create an IterableFunctor instance of the same type from an Iterator
|
LazyListX<T> |
withCollector(java.util.stream.Collector<T,?,java.util.List<T>> collector) |
add, addAll, clear, contains, containsAll, equals, evaluation, get, handleStrict, hashCode, isEager, isEmpty, isLazy, isMaterialized, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray, unwrapclone, finalize, getClass, notify, notifyAll, wait, wait, waitallTypeclasses, anyM, append, append, cast, coflatMap, combinations, combinations, combine, combine, compareTo, completable, coproduct, cycle, cycle, cycleUntil, cycleWhile, defaultCollector, defer, deleteBetween, distinct, drop, dropRight, dropUntil, dropWhile, empty, fill, filter, filterNot, flatMap, flatMapP, flatMapS, forEach2, forEach2, forEach3, forEach3, forEach4, forEach4, fromIterable, fromIterable, fromIterator, fromPublisher, generate, grouped, grouped, grouped, grouped, groupedStatefullyUntil, groupedUntil, groupedUntil, groupedWhile, groupedWhile, head, headMaybe, immutableCollector, insertAt, insertAtS, intersperse, iterate, kindCokleisli, kindKleisli, liftM, limit, limitLast, limitUntil, limitWhile, listX, listXCollector, map, mapM, minus, minus, minusAll, narrow, narrowK, nested, notNull, of, ofType, onEmpty, onEmptyGet, onEmptySwitch, onEmptyThrow, peek, permutations, plus, plus, plusAll, plusAll, plusInOrder, plusLoop, plusLoop, prepend, prepend, prependS, product, range, rangeLong, recover, recover, removeAll, removeAllI, removeAllS, retainAll, retainAllI, retainAllS, retry, retry, reverse, scanLeft, scanLeft, scanRight, scanRight, shuffle, shuffle, singleton, size, skip, skipLast, skipUntil, skipWhile, slice, sliding, sliding, sorted, sorted, sorted, stream, tail, tailRec, take, takeRight, takeUntil, takeWhile, trampoline, unfold, unit, with, zip, zip, zip, zip3, zip3, zip4, zip4, zipP, zipP, zipS, zipS, zipWith, zipWithIndex, zipWithP, zipWithSadd, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, spliterator, toArray, toArrayflatMapP, reducemapToDouble, mapToInt, mapToLong, subscribe, traversablegroupedStatefullyUntilT, groupedT, groupedUntilT, groupedWhileT, slidingT, slidingTfixedDelay, onePer, xPerpublic LazyListX(java.util.List<T> list, ReactiveSeq<T> seq, java.util.stream.Collector<T,?,java.util.List<T>> collector, Evaluation strict)
public LazyListX(java.util.List<T> list, ReactiveSeq<T> seq, java.util.stream.Collector<T,?,java.util.List<T>> collector)
public LazyListX<T> withCollector(java.util.stream.Collector<T,?,java.util.List<T>> collector)
withCollector in interface ListX<T>public ListX<T> materialize()
materialize in interface CollectionX<T>materialize in interface ListX<T>materialize in class AbstractLazyCollection<T,java.util.List<T>>public java.lang.String toString()
toString in class AbstractLazyCollection<T,java.util.List<T>>public <T1> java.util.stream.Collector<T1,?,java.util.List<T1>> getCollector()
getCollector in interface ListX<T>public void replaceAll(java.util.function.UnaryOperator<T> operator)
replaceAll in interface java.util.List<T>public void sort(java.util.Comparator<? super T> c)
sort in interface java.util.List<T>public boolean addAll(int index,
java.util.Collection<? extends T> c)
addAll in interface java.util.List<T>public int indexOf(java.lang.Object o)
indexOf in interface java.util.List<T>public int lastIndexOf(java.lang.Object o)
lastIndexOf in interface java.util.List<T>public java.util.ListIterator<T> listIterator()
listIterator in interface java.util.List<T>public java.util.ListIterator<T> listIterator(int index)
listIterator in interface java.util.List<T>public ListX<T> subList(int fromIndex, int toIndex)
IndexedSequenceXsubList in interface IndexedSequenceX<T>subList in interface MutableSequenceX<T>subList in interface ListX<T>subList in interface java.util.List<T>fromIndex - Index of our sub sequence (inclusive)toIndex - Index of our sub sequence (exclusive)public java.util.Iterator<T> iterator()
iterator in interface CollectionX<T>iterator in interface java.lang.Iterable<T>iterator in interface java.util.Collection<T>iterator in interface java.util.List<T>iterator in class AbstractLazyCollection<T,java.util.List<T>>public <X> LazyListX<X> fromStream(ReactiveSeq<X> stream)
fromStream in interface LazyCollectionX<T>fromStream in interface ListX<T>stream - Create a MultableCollectionX from a Streampublic <T1> LazyListX<T1> from(java.util.Collection<T1> c)
CollectionXpublic <U> LazyListX<U> unitIterator(java.util.Iterator<U> it)
Traversable
ReactiveSeq<Integer> newSeq = seq.unitIterable(myIterator);
unitIterator in interface Traversable<T>unitIterator in interface ListX<T>it - Iterator to create new IterableFunctor frompublic <R> LazyListX<R> unit(java.util.Collection<R> col)
FluentCollectionX