T - the type of elements held in this toXpublic class LazyPSetX<T> extends AbstractLazyPersistentCollection<T,org.pcollections.PSet<T>> implements PersistentSetX<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.PersistentSetX.CompletablePersistentSetX<T>, PersistentSetX.Instanceslist, seq| Constructor and Description |
|---|
LazyPSetX(org.pcollections.PSet<T> list,
ReactiveSeq<T> seq,
Reducer<org.pcollections.PSet<T>> reducer,
Evaluation strict) |
| Modifier and Type | Method and Description |
|---|---|
static <T> java.util.function.Function<ReactiveSeq<org.pcollections.PSet<T>>,org.pcollections.PSet<T>> |
asyncSet() |
PersistentSetX<T> |
eager() |
<T1> LazyPSetX<T1> |
from(java.util.Collection<T1> c)
Conctruct an Extended Collection from a standard Collection
|
<X> LazyPSetX<X> |
fromStream(ReactiveSeq<X> stream) |
PersistentSetX<T> |
lazy() |
PersistentSetX<T> |
materialize() |
PersistentSetX<T> |
minus(java.lang.Object remove)
Remove the specified element from this toX
|
PersistentSetX<T> |
minusAll(java.util.Collection<?> list)
Remove all the specified elements from this toX
|
PersistentSetX<T> |
plus(T e)
Add an element to this Collection
|
PersistentSetX<T> |
plusAll(java.util.Collection<? extends T> list)
Add all supplied elements to this Collection
|
PersistentSetX<T> |
plusLoop(int max,
java.util.function.IntFunction<T> value) |
PersistentSetX<T> |
plusLoop(java.util.function.Supplier<java.util.Optional<T>> supplier) |
PersistentSetX<T> |
type(Reducer<? extends org.pcollections.PSet<T>> reducer) |
<R> LazyPSetX<R> |
unit(java.util.Collection<R> col)
Create a new instance of the same colleciton type from the supplied toX
|
<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, 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, append, append, cast, coflatMap, combinations, combinations, combine, combine, completable, coproduct, cycle, cycle, cycleUntil, cycleWhile, deleteBetween, distinct, drop, dropRight, dropUntil, dropWhile, empty, emptyUnit, filter, filterNot, flatMap, flatMapP, flatMapS, forEach2, forEach2, forEach3, forEach3, forEach4, forEach4, fromIterable, fromIterator, fromPublisher, generate, grouped, grouped, grouped, grouped, groupedStatefullyUntil, groupedUntil, groupedUntil, groupedWhile, groupedWhile, insertAt, insertAtS, intersperse, iterate, kindCokleisli, kindKleisli, limit, limitLast, limitUntil, limitWhile, map, mapM, monoid, narrow, narrowK, nested, notNull, of, ofType, onEmpty, onEmptyGet, onEmptySwitch, onEmptyThrow, permutations, persistentSetX, 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, tailRec, take, takeRight, takeUntil, takeWhile, trampoline, unfold, unit, widen, 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, retainAll, size, spliterator, toArray, toArrayflatMapP, reduceevaluation, findAny, findFirst, fromCollection, getAtIndex, groupBy, head, headAndTail, isEager, isLazy, isMaterialized, 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, xPerunwrap, unwrapIfInstance, unwrapNestedpublic LazyPSetX(org.pcollections.PSet<T> list, ReactiveSeq<T> seq, Reducer<org.pcollections.PSet<T>> reducer, Evaluation strict)
public static final <T> java.util.function.Function<ReactiveSeq<org.pcollections.PSet<T>>,org.pcollections.PSet<T>> asyncSet()
public PersistentSetX<T> materialize()
materialize in interface CollectionX<T>materialize in interface PersistentSetX<T>public PersistentSetX<T> type(Reducer<? extends org.pcollections.PSet<T>> reducer)
type in interface PersistentSetX<T>public <X> LazyPSetX<X> fromStream(ReactiveSeq<X> stream)
fromStream in interface LazyCollectionX<T>fromStream in interface PersistentSetX<T>stream - Create a MultableCollectionX from a Streampublic <T1> LazyPSetX<T1> from(java.util.Collection<T1> c)
CollectionXfrom in interface CollectionX<T>from in interface PersistentSetX<T>c - Collection to extendpublic PersistentSetX<T> lazy()
lazy in interface CollectionX<T>lazy in interface PersistentSetX<T>public PersistentSetX<T> eager()
eager in interface CollectionX<T>eager in interface PersistentSetX<T>public PersistentSetX<T> plus(T e)
FluentCollectionXplus in interface FluentCollectionX<T>plus in interface LazyCollectionX<T>plus in interface PersistentSetX<T>plus in interface org.pcollections.PCollection<T>plus in interface org.pcollections.PSet<T>e - Element to addpublic PersistentSetX<T> plusAll(java.util.Collection<? extends T> list)
FluentCollectionXplusAll in interface FluentCollectionX<T>plusAll in interface LazyCollectionX<T>plusAll in interface PersistentSetX<T>plusAll in interface org.pcollections.PCollection<T>plusAll in interface org.pcollections.PSet<T>list - of elements to addpublic PersistentSetX<T> minusAll(java.util.Collection<?> list)
FluentCollectionXminusAll in interface FluentCollectionX<T>minusAll in interface LazyCollectionX<T>minusAll in interface PersistentSetX<T>minusAll in interface org.pcollections.PCollection<T>minusAll in interface org.pcollections.PSet<T>list - of elements to removepublic PersistentSetX<T> minus(java.lang.Object remove)
FluentCollectionXminus in interface FluentCollectionX<T>minus in interface LazyCollectionX<T>minus in interface PersistentSetX<T>minus in interface org.pcollections.PCollection<T>minus in interface org.pcollections.PSet<T>remove - Element to removepublic <U> LazyPSetX<U> unitIterator(java.util.Iterator<U> it)
Traversable
ReactiveSeq<Integer> newSeq = seq.unitIterable(myIterator);
unitIterator in interface Traversable<T>unitIterator in interface PersistentSetX<T>it - Iterator to create new IterableFunctor frompublic <R> LazyPSetX<R> unit(java.util.Collection<R> col)
FluentCollectionXunit in interface FluentCollectionX<T>unit in interface PersistentSetX<T>col - Collection data to populate the new toXpublic PersistentSetX<T> plusLoop(int max, java.util.function.IntFunction<T> value)
plusLoop in interface FluentCollectionX<T>plusLoop in interface PersistentSetX<T>plusLoop in class AbstractLazyPersistentCollection<T,org.pcollections.PSet<T>>public PersistentSetX<T> plusLoop(java.util.function.Supplier<java.util.Optional<T>> supplier)
plusLoop in interface FluentCollectionX<T>plusLoop in interface PersistentSetX<T>plusLoop in class AbstractLazyPersistentCollection<T,org.pcollections.PSet<T>>