T - the type of elements held in this toXpublic class LazyLinkedListX<T> extends AbstractLazyPersistentCollection<T,org.pcollections.PStack<T>> implements LinkedListX<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.
DequeX<Integer> q = DequeX.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.| Modifier and Type | Class and Description |
|---|---|
class |
LazyLinkedListX.PStackGeneator<T> |
LinkedListX.CompletableLinkedListX<T>, LinkedListX.Instanceslist, seq| Constructor and Description |
|---|
LazyLinkedListX(org.pcollections.PStack<T> list,
ReactiveSeq<T> seq,
Reducer<org.pcollections.PStack<T>> reducer,
Evaluation strict) |
LazyLinkedListX(org.pcollections.PStack<T> list,
ReactiveSeq<T> seq,
Reducer<org.pcollections.PStack<T>> reducer,
FoldToList<T> generator,
Evaluation strict) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
T element) |
boolean |
addAll(int index,
java.util.Collection<? extends T> c) |
static <T> java.util.function.Function<ReactiveSeq<org.pcollections.PStack<T>>,org.pcollections.PStack<T>> |
asyncLinkedList() |
LinkedListX<T> |
eager() |
<T1> LazyLinkedListX<T1> |
from(java.util.Collection<T1> c)
Conctruct an Extended Collection from a standard Collection
|
<X> LazyLinkedListX<X> |
fromStream(ReactiveSeq<X> stream)
Reduce (immutable Collection) a Stream to a PStack, note for efficiency reasons,
the emitted PStack is reversed.
|
T |
get(int index) |
int |
indexOf(java.lang.Object o) |
int |
lastIndexOf(java.lang.Object o) |
LinkedListX<T> |
lazy() |
java.util.ListIterator<T> |
listIterator() |
java.util.ListIterator<T> |
listIterator(int index) |
LinkedListX<T> |
materialize() |
org.pcollections.PStack<T> |
materializeList(ReactiveSeq<T> toUse) |
LinkedListX<T> |
minus(int i)
Remove the element at the supplied index
|
LinkedListX<T> |
minus(java.lang.Object remove)
Remove the specified element from this toX
|
LinkedListX<T> |
minusAll(java.util.Collection<?> list)
Remove all the specified elements from this toX
|
LinkedListX<T> |
plus(int i,
T e)
Add the supplied element at the supplied index
|
LinkedListX<T> |
plus(T e)
Add an element to this Collection
|
LinkedListX<T> |
plusAll(java.util.Collection<? extends T> list)
Add all supplied elements to this Collection
|
LinkedListX<T> |
plusAll(int i,
java.util.Collection<? extends T> list)
Add all of the supplied elements at the supplied index
|
LinkedListX<T> |
plusLoop(int max,
java.util.function.IntFunction<T> value) |
LinkedListX<T> |
plusLoop(java.util.function.Supplier<java.util.Optional<T>> supplier) |
T |
remove(int index) |
T |
set(int index,
T element) |
org.pcollections.PStack<T> |
subList(int start) |
LinkedListX<T> |
subList(int start,
int end)
Create a sub sequence between the two supplied index
|
LinkedListX<T> |
type(Reducer<? extends org.pcollections.PStack<T>> reducer) |
<R> LazyLinkedListX<R> |
unit(java.util.Collection<R> col)
Create a new instance of the same colleciton type from the supplied toX
|
<U> LazyLinkedListX<U> |
unitIterator(java.util.Iterator<U> it)
Create an IterableFunctor instance of the same type from an Iterator
|
LinkedListX<T> |
with(int i,
T e)
Replace the value at the specifed index with the supplied value
|
add, addAll, clear, contains, containsAll, equals, evaluation, get, handleStrict, hashCode, isEager, isEmpty, isLazy, isMaterialized, iterator, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray, toString, unwrapclone, finalize, getClass, notify, notifyAll, wait, wait, waitallTypeclasses, anyM, append, append, cast, coflatMap, combinations, combinations, combine, combine, completable, coproduct, cycle, cycle, cycleUntil, cycleWhile, deleteBetween, distinct, drop, dropRight, dropUntil, dropWhile, empty, emptyUnit, fill, filter, filterNot, flatMap, flatMapP, flatMapS, forEach2, forEach2, forEach3, forEach3, forEach4, forEach4, fromIterable, fromIterator, fromPublisher, generate, grouped, grouped, grouped, grouped, groupedStatefullyUntil, groupedUntil, groupedUntil, groupedWhile, groupedWhile, head, headMaybe, insertAt, insertAtS, intersperse, iterate, kindCokleisli, kindKleisli, liftM, limit, limitLast, limitUntil, limitWhile, linkedListX, map, mapM, monoid, narrow, narrowK, nested, notNull, of, ofType, onEmpty, onEmptyGet, onEmptySwitch, onEmptyThrow, permutations, plusInOrder, prepend, prepend, prependS, product, range, rangeLong, recover, recover, removeAll, removeAllI, removeAllS, retainAll, retainAllI, retainAllS, retry, retry, reverse, scanLeft, scanLeft, scanRight, scanRight, shuffle, shuffle, singleton, skip, skipLast, skipUntil, skipWhile, slice, sliding, sliding, sorted, sorted, sorted, stream, tail, tailRec, take, takeRight, takeUntil, takeWhile, trampoline, unfold, unit, widen, widen2, zip, zip, zip, zip3, zip3, zip4, zip4, zipP, zipP, zipS, zipS, zipWith, zipWithIndex, zipWithP, zipWithSadd, addAll, clear, remove, removeAll, retainAlladd, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, replaceAll, retainAll, size, sort, spliterator, toArray, toArrayflatMapP, reduceevaluation, findAny, findFirst, fromCollection, getAtIndex, groupBy, headAndTail, isEager, isEmpty, isLazy, isMaterialized, iterator, materializeReversed, peek, single, single, singleUnsafe, takeOne, toXasFunction, foldFuture, foldLazy, foldTry, forEach, forEach, forEach, forEach, forEach, forEachSubscribe, forEachSubscribe, forEachSubscribe, runFuture, runLazy, seq, toListX, toSetX, visitallMatch, anyMatch, collect, collectors, commonPrefix, commonSuffix, count, count, countDistinct, countDistinct, countDistinctBy, countDistinctBy, max, maxBy, min, minBy, mode, noneMatch, sum, sumDouble, sumInt, sumLong, to, toList, toMap, toMap, toSet, toString, toStringendsWith, endsWithIterable, firstValue, foldLeft, foldLeft, foldLeft, foldLeft, foldRight, foldRight, foldRight, foldRightMapToType, get, join, join, join, mapReduce, mapReduce, print, print, printErr, printOut, reduce, reduce, reduce, reduce, reduce, reduce, schedule, scheduleFixedDelay, scheduleFixedRate, startsWith, startsWithIterable, xMatchunwrap, unwrapIfInstance, unwrapNestedpublic LazyLinkedListX(org.pcollections.PStack<T> list, ReactiveSeq<T> seq, Reducer<org.pcollections.PStack<T>> reducer, FoldToList<T> generator, Evaluation strict)
public LazyLinkedListX(org.pcollections.PStack<T> list, ReactiveSeq<T> seq, Reducer<org.pcollections.PStack<T>> reducer, Evaluation strict)
public static final <T> java.util.function.Function<ReactiveSeq<org.pcollections.PStack<T>>,org.pcollections.PStack<T>> asyncLinkedList()
public org.pcollections.PStack<T> materializeList(ReactiveSeq<T> toUse)
materializeList in class AbstractLazyPersistentCollection<T,org.pcollections.PStack<T>>public LinkedListX<T> materialize()
materialize in interface CollectionX<T>materialize in interface LinkedListX<T>public LinkedListX<T> lazy()
lazy in interface CollectionX<T>lazy in interface LinkedListX<T>public LinkedListX<T> eager()
eager in interface CollectionX<T>eager in interface LinkedListX<T>public LinkedListX<T> type(Reducer<? extends org.pcollections.PStack<T>> reducer)
type in interface LinkedListX<T>public <X> LazyLinkedListX<X> fromStream(ReactiveSeq<X> stream)
LinkedListX
PStack<Integer> list = PStacks.fromStream(Stream.of(1,2,3));
//list = [3,2,1]
fromStream in interface LazyCollectionX<T>fromStream in interface LinkedListX<T>stream - to convert to a PVectorpublic <T1> LazyLinkedListX<T1> from(java.util.Collection<T1> c)
CollectionXfrom in interface CollectionX<T>from in interface LinkedListX<T>c - Collection to extendpublic LinkedListX<T> minusAll(java.util.Collection<?> list)
FluentCollectionXminusAll in interface FluentCollectionX<T>minusAll in interface IndexedSequenceX<T>minusAll in interface LazyCollectionX<T>minusAll in interface LinkedListX<T>minusAll in interface org.pcollections.PCollection<T>minusAll in interface org.pcollections.PSequence<T>minusAll in interface org.pcollections.PStack<T>list - of elements to removepublic LinkedListX<T> minus(java.lang.Object remove)
FluentCollectionXminus in interface FluentCollectionX<T>minus in interface IndexedSequenceX<T>minus in interface LazyCollectionX<T>minus in interface LinkedListX<T>minus in interface org.pcollections.PCollection<T>minus in interface org.pcollections.PSequence<T>minus in interface org.pcollections.PStack<T>remove - Element to removepublic LinkedListX<T> with(int i, T e)
IndexedSequenceXwith in interface IndexedSequenceX<T>with in interface LinkedListX<T>with in interface org.pcollections.PSequence<T>with in interface org.pcollections.PStack<T>i - Index to one value ate - Value to usePStack.with(int, java.lang.Object)public LinkedListX<T> plus(int i, T e)
IndexedSequenceXplus in interface IndexedSequenceX<T>plus in interface LinkedListX<T>plus in interface org.pcollections.PSequence<T>plus in interface org.pcollections.PStack<T>i - Index to add element ate - Element to addPStack.plus(int, java.lang.Object)public LinkedListX<T> plus(T e)
FluentCollectionXplus in interface FluentCollectionX<T>plus in interface IndexedSequenceX<T>plus in interface LazyCollectionX<T>plus in interface LinkedListX<T>plus in interface org.pcollections.PCollection<T>plus in interface org.pcollections.PSequence<T>plus in interface org.pcollections.PStack<T>e - Element to addpublic LinkedListX<T> plusAll(java.util.Collection<? extends T> list)
FluentCollectionXplusAll in interface FluentCollectionX<T>plusAll in interface IndexedSequenceX<T>plusAll in interface LazyCollectionX<T>plusAll in interface LinkedListX<T>plusAll in interface org.pcollections.PCollection<T>plusAll in interface org.pcollections.PSequence<T>plusAll in interface org.pcollections.PStack<T>list - of elements to addpublic LinkedListX<T> plusAll(int i, java.util.Collection<? extends T> list)
IndexedSequenceXplusAll in interface IndexedSequenceX<T>plusAll in interface LinkedListX<T>plusAll in interface org.pcollections.PSequence<T>plusAll in interface org.pcollections.PStack<T>i - Index to add element atlist - Collection of elements to addPStack.plusAll(int, java.util.Collection)public LinkedListX<T> minus(int i)
IndexedSequenceXminus in interface IndexedSequenceX<T>minus in interface LinkedListX<T>minus in interface org.pcollections.PSequence<T>minus in interface org.pcollections.PStack<T>i - Index at which to remvoe elementPStack.minus(int)public LinkedListX<T> subList(int start, int end)
IndexedSequenceXsubList in interface IndexedSequenceX<T>subList in interface LinkedListX<T>subList in interface java.util.List<T>subList in interface org.pcollections.PSequence<T>subList in interface org.pcollections.PStack<T>start - Index of our sub sequence (inclusive)end - Index of our sub sequence (exclusive)public boolean addAll(int index,
java.util.Collection<? extends T> c)
public void add(int index,
T element)
public T remove(int index)
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 org.pcollections.PStack<T> subList(int start)
subList in interface org.pcollections.PStack<T>public <U> LazyLinkedListX<U> unitIterator(java.util.Iterator<U> it)
Traversable
ReactiveSeq<Integer> newSeq = seq.unitIterable(myIterator);
unitIterator in interface Traversable<T>unitIterator in interface LinkedListX<T>it - Iterator to create new IterableFunctor frompublic <R> LazyLinkedListX<R> unit(java.util.Collection<R> col)
FluentCollectionXunit in interface FluentCollectionX<T>unit in interface LinkedListX<T>col - Collection data to populate the new toXpublic LinkedListX<T> plusLoop(int max, java.util.function.IntFunction<T> value)
plusLoop in interface FluentCollectionX<T>plusLoop in interface LinkedListX<T>plusLoop in class AbstractLazyPersistentCollection<T,org.pcollections.PStack<T>>public LinkedListX<T> plusLoop(java.util.function.Supplier<java.util.Optional<T>> supplier)
plusLoop in interface FluentCollectionX<T>plusLoop in interface LinkedListX<T>plusLoop in class AbstractLazyPersistentCollection<T,org.pcollections.PStack<T>>