T
- the type of elements held in this collectionpublic class LazyPSetX<T> extends AbstractLazyPersistentCollection<T,org.pcollections.PSet<T>> implements PSetX<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.Fn1.µ, Fn1.FunctionalOperations<T1,R>
list, seq
Constructor and Description |
---|
LazyPSetX(org.pcollections.PSet<T> list) |
LazyPSetX(org.pcollections.PSet<T> list,
ReactiveSeq<T> seq) |
LazyPSetX(ReactiveSeq<T> seq) |
Modifier and Type | Method and Description |
---|---|
<T1> LazyPSetX<T1> |
from(java.util.Collection<T1> c)
Conctruct an Extended Collection from a standard Collection
|
PSetX<T> |
materialize() |
PSetX<T> |
minus(java.lang.Object remove)
Remove the specified element from this collection
|
PSetX<T> |
minusAll(java.util.Collection<?> list)
Remove all the specified elements from this collection
|
PSetX<T> |
plus(T e)
Add an element to this Collection
|
PSetX<T> |
plusAll(java.util.Collection<? extends T> list)
Add all supplied elements to this Collection
|
PSetX<T> |
plusLoop(int max,
java.util.function.IntFunction<T> value) |
PSetX<T> |
plusLoop(java.util.function.Supplier<java.util.Optional<T>> supplier) |
<R> LazyPSetX<R> |
unit(java.util.Collection<R> col)
Create a new instance of the same colleciton type from the supplied collection
|
<U> LazyPSetX<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
append, append, cast, coflatMap, combinations, combinations, combine, cycle, cycle, cycleUntil, cycleWhile, deleteBetween, distinct, drop, dropRight, dropUntil, dropWhile, empty, emptyUnit, filter, filterNot, flatMap, flatMapP, flatMapS, forEach2, forEach2, forEach3, forEach3, forEach4, forEach4, fromCollection, fromIterable, fromPublisher, fromStream, generate, grouped, grouped, grouped, grouped, groupedStatefullyUntil, groupedUntil, groupedUntil, groupedWhile, groupedWhile, insertAt, insertAtS, intersperse, iterate, limit, limitLast, limitUntil, limitWhile, map, monoid, narrow, notNull, of, ofType, onEmpty, onEmptyGet, onEmptySwitch, onEmptyThrow, permutations, plusInOrder, prepend, prepend, prependS, range, rangeLong, recover, recover, removeAllS, removeAllS, removeAllS, retainAllS, retainAllS, retainAllS, retry, retry, reverse, scanLeft, scanLeft, scanRight, scanRight, shuffle, shuffle, singleton, skip, skipLast, skipUntil, skipWhile, slice, sliding, sliding, sorted, sorted, sorted, stream, take, takeRight, takeUntil, takeWhile, toPSet, toPSetX, trampoline, unfold, unit, zip, zip, zip3, zip4, zipS, zipS, zipWithIndex
add, addAll, clear, remove, removeAll, retainAll
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, spliterator, toArray, toArray
findAny, findFirst, getAtIndex, groupBy, head, headAndTail, 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, toPQueueX, 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
groupedStatefullyUntilT, groupedT, groupedUntilT, groupedWhileT, slidingT, slidingT
fixedDelay, onePer, xPer
public LazyPSetX(org.pcollections.PSet<T> list, ReactiveSeq<T> seq)
public LazyPSetX(org.pcollections.PSet<T> list)
public LazyPSetX(ReactiveSeq<T> seq)
public PSetX<T> materialize()
materialize
in interface CollectionX<T>
materialize
in interface PSetX<T>
public <T1> LazyPSetX<T1> from(java.util.Collection<T1> c)
CollectionX
from
in interface CollectionX<T>
from
in interface PersistentCollectionX<T>
from
in interface PSetX<T>
c
- Collection to extendpublic PSetX<T> plus(T e)
FluentCollectionX
public PSetX<T> plusAll(java.util.Collection<? extends T> list)
FluentCollectionX
plusAll
in interface FluentCollectionX<T>
plusAll
in interface PSetX<T>
plusAll
in interface org.pcollections.PCollection<T>
plusAll
in interface org.pcollections.PSet<T>
list
- of elements to addpublic PSetX<T> minusAll(java.util.Collection<?> list)
FluentCollectionX
minusAll
in interface FluentCollectionX<T>
minusAll
in interface PSetX<T>
minusAll
in interface org.pcollections.PCollection<T>
minusAll
in interface org.pcollections.PSet<T>
list
- of elements to removepublic PSetX<T> minus(java.lang.Object remove)
FluentCollectionX
public <U> LazyPSetX<U> unitIterator(java.util.Iterator<U> it)
Traversable
ReactiveSeq<Integer> newSeq = seq.unitIterable(myIterator);
unitIterator
in interface Traversable<T>
unitIterator
in interface PSetX<T>
it
- Iterator to create new IterableFunctor frompublic <R> LazyPSetX<R> unit(java.util.Collection<R> col)
FluentCollectionX
unit
in interface FluentCollectionX<T>
unit
in interface PersistentCollectionX<T>
unit
in interface PSetX<T>
col
- Collection data to populate the new collectionpublic PSetX<T> plusLoop(int max, java.util.function.IntFunction<T> value)
plusLoop
in interface FluentCollectionX<T>
plusLoop
in interface PSetX<T>
plusLoop
in class AbstractLazyPersistentCollection<T,org.pcollections.PSet<T>>