T - the type of elements held in this toXpublic class LazyPQueueX<T> extends AbstractLazyPersistentCollection<T,org.pcollections.PQueue<T>> implements PersistentQueueX<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.PersistentQueueX.CompletablePersistentQueueX<T>, PersistentQueueX.Instanceslist, seq| Constructor and Description |
|---|
LazyPQueueX(org.pcollections.PQueue<T> list,
ReactiveSeq<T> seq,
Reducer<org.pcollections.PQueue<T>> reducer,
Evaluation strict) |
| Modifier and Type | Method and Description |
|---|---|
static <T> java.util.function.Function<ReactiveSeq<org.pcollections.PQueue<T>>,org.pcollections.PQueue<T>> |
asyncQueue() |
PersistentQueueX<T> |
eager() |
T |
element() |
<T1> LazyPQueueX<T1> |
from(java.util.Collection<T1> c)
Conctruct an Extended Collection from a standard Collection
|
<X> LazyPQueueX<X> |
fromStream(ReactiveSeq<X> stream) |
PersistentQueueX<T> |
lazy() |
PersistentQueueX<T> |
materialize() |
PersistentQueueX<T> |
minus() |
PersistentQueueX<T> |
minus(java.lang.Object remove)
Remove the specified element from this toX
|
PersistentQueueX<T> |
minusAll(java.util.Collection<?> list)
Remove all the specified elements from this toX
|
boolean |
offer(T o) |
T |
peek() |
PersistentQueueX<T> |
plus(T e)
Add an element to this Collection
|
PersistentQueueX<T> |
plusAll(java.util.Collection<? extends T> list)
Add all supplied elements to this Collection
|
PersistentQueueX<T> |
plusLoop(int max,
java.util.function.IntFunction<T> value) |
PersistentQueueX<T> |
plusLoop(java.util.function.Supplier<java.util.Optional<T>> supplier) |
T |
poll() |
T |
remove() |
PersistentQueueX<T> |
type(Reducer<? extends org.pcollections.PQueue<T>> reducer) |
<R> LazyPQueueX<R> |
unit(java.util.Collection<R> col)
Create a new instance of the same colleciton type from the supplied toX
|
<U> LazyPQueueX<U> |
unitIterator(java.util.Iterator<U> it)
Create an IterableFunctor instance of the same type from an Iterator
|
add, addAll, clear, contains, containsAll, equals, evaluation, get, handleStrict, hashCode, isEager, isEmpty, isLazy, isMaterialized, iterator, materializeList, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray, toString, unwrapclone, finalize, getClass, notify, notifyAll, wait, wait, waitallTypeclasses, anyM, cast, coflatMap, combinations, combinations, combine, combine, completable, coproduct, cycle, cycle, cycleUntil, cycleWhile, distinct, drop, dropRight, dropUntil, dropWhile, empty, emptyUnit, fill, filter, filterNot, flatMap, forEach2, forEach2, forEach3, forEach3, forEach4, forEach4, fromIterable, fromIterator, fromPublisher, generate, grouped, grouped, grouped, grouped, groupedStatefullyUntil, groupedUntil, groupedUntil, groupedWhile, groupedWhile, intersperse, iterate, kindCokleisli, kindKleisli, limit, limitLast, limitUntil, limitWhile, map, mapM, monoid, narrow, narrowK, nested, notNull, of, ofType, onEmpty, onEmptyGet, onEmptySwitch, onEmptyThrow, permutations, persistentQueueX, plusInOrder, product, range, rangeLong, recover, recover, removeAll, removeAllI, removeAllS, retainAll, retainAllI, retainAllS, reverse, scanLeft, scanLeft, scanRight, scanRight, shuffle, shuffle, singleton, skip, skipLast, skipUntil, skipWhile, slice, sliding, sliding, sorted, sorted, sorted, stream, tailRec, take, takeRight, takeUntil, takeWhile, toPSet, trampoline, unfold, unit, widen, widen2, zip, zip, zip, zip3, zip3, zip4, zip4, zipP, zipP, zipS, zipS, zipWith, zipWithIndex, zipWithP, zipWithSadd, addAll, clear, remove, removeAll, retainAllappend, append, deleteBetween, flatMapP, flatMapP, flatMapS, insertAt, insertAtS, prepend, prepend, prependS, reduce, retry, retryevaluation, findAny, findFirst, fromCollection, getAtIndex, groupBy, head, 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, xMatchmapToDouble, mapToInt, mapToLong, subscribe, traversablegroupedStatefullyUntilT, groupedT, groupedUntilT, groupedWhileT, slidingT, slidingTfixedDelay, onePer, xPercontains, containsAll, equals, hashCode, parallelStream, removeIf, size, spliterator, toArray, toArrayunwrap, unwrapIfInstance, unwrapNestedpublic LazyPQueueX(org.pcollections.PQueue<T> list, ReactiveSeq<T> seq, Reducer<org.pcollections.PQueue<T>> reducer, Evaluation strict)
public static final <T> java.util.function.Function<ReactiveSeq<org.pcollections.PQueue<T>>,org.pcollections.PQueue<T>> asyncQueue()
public PersistentQueueX<T> materialize()
materialize in interface CollectionX<T>materialize in interface PersistentQueueX<T>public PersistentQueueX<T> type(Reducer<? extends org.pcollections.PQueue<T>> reducer)
type in interface PersistentQueueX<T>public <X> LazyPQueueX<X> fromStream(ReactiveSeq<X> stream)
fromStream in interface LazyCollectionX<T>fromStream in interface PersistentQueueX<T>stream - Create a MultableCollectionX from a Streampublic <T1> LazyPQueueX<T1> from(java.util.Collection<T1> c)
CollectionXfrom in interface CollectionX<T>from in interface PersistentQueueX<T>c - Collection to extendpublic PersistentQueueX<T> lazy()
lazy in interface CollectionX<T>lazy in interface PersistentQueueX<T>public PersistentQueueX<T> eager()
eager in interface CollectionX<T>eager in interface PersistentQueueX<T>public PersistentQueueX<T> minus()
minus in interface PersistentQueueX<T>minus in interface org.pcollections.PQueue<T>public PersistentQueueX<T> plus(T e)
FluentCollectionXplus in interface FluentCollectionX<T>plus in interface LazyCollectionX<T>plus in interface PersistentQueueX<T>plus in interface org.pcollections.PCollection<T>plus in interface org.pcollections.PQueue<T>e - Element to addpublic PersistentQueueX<T> plusAll(java.util.Collection<? extends T> list)
FluentCollectionXplusAll in interface FluentCollectionX<T>plusAll in interface LazyCollectionX<T>plusAll in interface PersistentQueueX<T>plusAll in interface org.pcollections.PCollection<T>plusAll in interface org.pcollections.PQueue<T>list - of elements to addpublic PersistentQueueX<T> minusAll(java.util.Collection<?> list)
FluentCollectionXminusAll in interface FluentCollectionX<T>minusAll in interface LazyCollectionX<T>minusAll in interface PersistentQueueX<T>minusAll in interface org.pcollections.PCollection<T>minusAll in interface org.pcollections.PQueue<T>list - of elements to removepublic boolean offer(T o)
public T poll()
public T remove()
public PersistentQueueX<T> minus(java.lang.Object remove)
FluentCollectionXminus in interface FluentCollectionX<T>minus in interface LazyCollectionX<T>minus in interface PersistentQueueX<T>minus in interface org.pcollections.PCollection<T>minus in interface org.pcollections.PQueue<T>remove - Element to removepublic <U> LazyPQueueX<U> unitIterator(java.util.Iterator<U> it)
Traversable
ReactiveSeq<Integer> newSeq = seq.unitIterable(myIterator);
unitIterator in interface Traversable<T>unitIterator in interface PersistentQueueX<T>it - Iterator to create new IterableFunctor frompublic <R> LazyPQueueX<R> unit(java.util.Collection<R> col)
FluentCollectionXunit in interface FluentCollectionX<T>unit in interface PersistentQueueX<T>col - Collection data to populate the new toXpublic PersistentQueueX<T> plusLoop(int max, java.util.function.IntFunction<T> value)
plusLoop in interface FluentCollectionX<T>plusLoop in interface PersistentQueueX<T>plusLoop in class AbstractLazyPersistentCollection<T,org.pcollections.PQueue<T>>public PersistentQueueX<T> plusLoop(java.util.function.Supplier<java.util.Optional<T>> supplier)
plusLoop in interface FluentCollectionX<T>plusLoop in interface PersistentQueueX<T>plusLoop in class AbstractLazyPersistentCollection<T,org.pcollections.PQueue<T>>