T
- the type of elements held in this collectionpublic class LazyPQueueX<T> extends AbstractLazyPersistentCollection<T,org.pcollections.PQueue<T>> implements PQueueX<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.PQueueX.µ, PQueueX.Instances
Fn1.FunctionalOperations<T1,R>
list, seq
Constructor and Description |
---|
LazyPQueueX(org.pcollections.PQueue<T> list) |
LazyPQueueX(org.pcollections.PQueue<T> list,
ReactiveSeq<T> seq) |
LazyPQueueX(ReactiveSeq<T> seq) |
Modifier and Type | Method and Description |
---|---|
T |
element() |
<T1> LazyPQueueX<T1> |
from(java.util.Collection<T1> c)
Conctruct an Extended Collection from a standard Collection
|
PQueueX<T> |
materialize() |
PQueueX<T> |
minus() |
PQueueX<T> |
minus(java.lang.Object remove)
Remove the specified element from this collection
|
PQueueX<T> |
minusAll(java.util.Collection<?> list)
Remove all the specified elements from this collection
|
boolean |
offer(T o) |
T |
peek() |
PQueueX<T> |
plus(T e)
Add an element to this Collection
|
PQueueX<T> |
plusAll(java.util.Collection<? extends T> list)
Add all supplied elements to this Collection
|
PQueueX<T> |
plusLoop(int max,
java.util.function.IntFunction<T> value) |
PQueueX<T> |
plusLoop(java.util.function.Supplier<java.util.Optional<T>> supplier) |
T |
poll() |
T |
remove() |
<R> LazyPQueueX<R> |
unit(java.util.Collection<R> col)
Create a new instance of the same colleciton type from the supplied collection
|
<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, get, hashCode, isEmpty, iterator, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
cast, coflatMap, combinations, combinations, combine, cycle, cycle, cycleUntil, cycleWhile, distinct, drop, dropRight, dropUntil, dropWhile, empty, emptyUnit, fill, filter, filterNot, flatMap, forEach2, forEach2, forEach3, forEach3, forEach4, forEach4, fromCollection, fromIterable, fromPublisher, fromStream, generate, grouped, grouped, grouped, grouped, groupedStatefullyUntil, groupedUntil, groupedUntil, groupedWhile, groupedWhile, intersperse, iterate, limit, limitLast, limitUntil, limitWhile, map, monoid, narrow, narrowK, notNull, of, ofType, onEmpty, onEmptyGet, onEmptySwitch, onEmptyThrow, permutations, plusInOrder, range, rangeLong, recover, recover, removeAllS, removeAllS, removeAllS, retainAllS, retainAllS, retainAllS, reverse, scanLeft, scanLeft, scanRight, scanRight, shuffle, shuffle, singleton, skip, skipLast, skipUntil, skipWhile, slice, sliding, sliding, sorted, sorted, sorted, stream, take, takeRight, takeUntil, takeWhile, toPQueueX, toPSet, trampoline, unfold, unit, widen2, zip, zip, zip3, zip4, zipS, zipS, zipWithIndex
add, addAll, clear, remove, removeAll, retainAll
append, append, deleteBetween, flatMapP, flatMapS, insertAt, insertAtS, prepend, prepend, prependS
findAny, findFirst, getAtIndex, groupBy, head, headAndTail, isEmpty, iterator, peek, single, single, singleOptional
apply, foldFuture, foldLazy, foldTry, forEach, forEach, forEach, forEach, forEach, runFuture, runLazy, seq, visit
andThen, andThen, bind, compose, functionOps, lift, lift, liftF, liftOpt, liftTry, memoize, memoize, product, reader, λ, λv
apply, applyPartially, applyPartially, curry, curry, from, toFunction
allMatch, anyMatch, avg, avgDouble, avgInt, avgLong, bitAnd, bitAndInt, bitAndLong, bitOr, bitOrInt, bitOrLong, collect, collectable, commonPrefix, commonSuffix, count, count, countDistinct, countDistinct, countDistinctBy, countDistinctBy, max, max, max, max, maxAll, maxAll, maxAll, maxAll, maxAllBy, maxAllBy, maxBy, maxBy, median, median, medianBy, medianBy, min, min, min, min, minAll, minAll, minAll, minAll, minAllBy, minAllBy, minBy, minBy, mode, modeAll, modeAllBy, modeBy, noneMatch, percentile, percentile, percentileBy, percentileBy, sum, sumDouble, sumInt, sumLong, toCollection, toList, toList, toMap, toMap, toSet, toSet, toString, toString
endsWith, 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, reduce, schedule, scheduleFixedDelay, scheduleFixedRate, startsWith, startsWithIterable, toConcurrentLazyCollection, toConcurrentLazyStreamable, toLazyCollection, xMatch
toDequeX, toFutureStream, toFutureStream, toListX, toMapX, toOptional, toPBagX, toPMapX, toPOrderedSetX, toPSetX, toPStackX, toPVectorX, toQueueX, toSetX, toSimpleReact, toSimpleReact, toSortedSetX, toStreamable, toValue
mapToDouble, mapToInt, mapToLong, subscribe, traversable
zip, zip3, zip4, zipP, zipP, zipWith, zipWithP, zipWithS
futureStream, getStreamable, jdkStream, reactiveSeq, reveresedJDKStream, reveresedStream
retry, retry
groupedStatefullyUntilT, groupedT, groupedUntilT, groupedWhileT, slidingT, slidingT
fixedDelay, onePer, xPer
public LazyPQueueX(org.pcollections.PQueue<T> list, ReactiveSeq<T> seq)
public LazyPQueueX(org.pcollections.PQueue<T> list)
public LazyPQueueX(ReactiveSeq<T> seq)
public PQueueX<T> materialize()
materialize
in interface CollectionX<T>
materialize
in interface PQueueX<T>
public <T1> LazyPQueueX<T1> from(java.util.Collection<T1> c)
CollectionX
from
in interface CollectionX<T>
from
in interface PersistentCollectionX<T>
from
in interface PQueueX<T>
c
- Collection to extendpublic PQueueX<T> plus(T e)
FluentCollectionX
public PQueueX<T> plusAll(java.util.Collection<? extends T> list)
FluentCollectionX
plusAll
in interface FluentCollectionX<T>
plusAll
in interface PQueueX<T>
plusAll
in interface org.pcollections.PCollection<T>
plusAll
in interface org.pcollections.PQueue<T>
list
- of elements to addpublic PQueueX<T> minusAll(java.util.Collection<?> list)
FluentCollectionX
minusAll
in interface FluentCollectionX<T>
minusAll
in interface PQueueX<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 PQueueX<T> minus(java.lang.Object remove)
FluentCollectionX
minus
in interface FluentCollectionX<T>
minus
in interface PQueueX<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 PQueueX<T>
it
- Iterator to create new IterableFunctor frompublic <R> LazyPQueueX<R> unit(java.util.Collection<R> col)
FluentCollectionX
unit
in interface FluentCollectionX<T>
unit
in interface PersistentCollectionX<T>
unit
in interface PQueueX<T>
col
- Collection data to populate the new collectionpublic PQueueX<T> plusLoop(int max, java.util.function.IntFunction<T> value)
plusLoop
in interface FluentCollectionX<T>
plusLoop
in interface PQueueX<T>
plusLoop
in class AbstractLazyPersistentCollection<T,org.pcollections.PQueue<T>>