T - the type of elements held in this toXpublic class LazyPBagX<T> extends AbstractLazyPersistentCollection<T,org.pcollections.PBag<T>> implements BagX<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.BagX.CompletableBagX<T>list, seq| Constructor and Description |
|---|
LazyPBagX(org.pcollections.PBag<T> list,
ReactiveSeq<T> seq,
Reducer<org.pcollections.PBag<T>> reducer,
Evaluation strict) |
| Modifier and Type | Method and Description |
|---|---|
static <T> java.util.function.Function<ReactiveSeq<org.pcollections.PBag<T>>,org.pcollections.PBag<T>> |
asyncBag() |
BagX<T> |
eager() |
<T1> LazyPBagX<T1> |
from(java.util.Collection<T1> c)
Conctruct an Extended Collection from a standard Collection
|
<X> LazyPBagX<X> |
fromStream(ReactiveSeq<X> stream) |
BagX<T> |
lazy() |
BagX<T> |
materialize() |
BagX<T> |
minus(java.lang.Object remove)
Remove the specified element from this toX
|
BagX<T> |
minusAll(java.util.Collection<?> list)
Remove all the specified elements from this toX
|
BagX<T> |
plus(T e)
Add an element to this Collection
|
BagX<T> |
plusAll(java.util.Collection<? extends T> list)
Add all supplied elements to this Collection
|
BagX<T> |
plusLoop(int max,
java.util.function.IntFunction<T> value) |
BagX<T> |
plusLoop(java.util.function.Supplier<java.util.Optional<T>> supplier) |
BagX<T> |
type(Reducer<? extends org.pcollections.PBag<T>> reducer) |
<R> LazyPBagX<R> |
unit(java.util.Collection<R> col)
Create a new instance of the same colleciton type from the supplied toX
|
<U> LazyPBagX<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, waitanyM, append, append, bagX, cast, coflatMap, combinations, combinations, combine, combine, completable, 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, 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, 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, zip, zip, zip, zip3, zip3, zip4, zip4, zipP, zipP, zipS, zipS, zipWith, zipWithIndex, zipWithP, zipWithSadd, addAll, clear, remove, removeAll, retainAllflatMapP, reduceevaluation, 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 LazyPBagX(org.pcollections.PBag<T> list, ReactiveSeq<T> seq, Reducer<org.pcollections.PBag<T>> reducer, Evaluation strict)
public static final <T> java.util.function.Function<ReactiveSeq<org.pcollections.PBag<T>>,org.pcollections.PBag<T>> asyncBag()
public BagX<T> plusLoop(int max, java.util.function.IntFunction<T> value)
plusLoop in interface FluentCollectionX<T>plusLoop in interface BagX<T>plusLoop in class AbstractLazyPersistentCollection<T,org.pcollections.PBag<T>>public BagX<T> plusLoop(java.util.function.Supplier<java.util.Optional<T>> supplier)
plusLoop in interface FluentCollectionX<T>plusLoop in interface BagX<T>plusLoop in class AbstractLazyPersistentCollection<T,org.pcollections.PBag<T>>public BagX<T> materialize()
materialize in interface CollectionX<T>materialize in interface BagX<T>public <X> LazyPBagX<X> fromStream(ReactiveSeq<X> stream)
fromStream in interface LazyCollectionX<T>fromStream in interface BagX<T>stream - Create a MultableCollectionX from a Streampublic <T1> LazyPBagX<T1> from(java.util.Collection<T1> c)
CollectionXpublic BagX<T> plus(T e)
FluentCollectionXplus in interface FluentCollectionX<T>plus in interface LazyCollectionX<T>plus in interface BagX<T>plus in interface org.pcollections.PBag<T>plus in interface org.pcollections.PCollection<T>e - Element to addpublic BagX<T> plusAll(java.util.Collection<? extends T> list)
FluentCollectionXplusAll in interface FluentCollectionX<T>plusAll in interface LazyCollectionX<T>plusAll in interface BagX<T>plusAll in interface org.pcollections.PBag<T>plusAll in interface org.pcollections.PCollection<T>list - of elements to addpublic BagX<T> minusAll(java.util.Collection<?> list)
FluentCollectionXminusAll in interface FluentCollectionX<T>minusAll in interface LazyCollectionX<T>minusAll in interface BagX<T>minusAll in interface org.pcollections.PBag<T>minusAll in interface org.pcollections.PCollection<T>list - of elements to removepublic BagX<T> minus(java.lang.Object remove)
FluentCollectionXminus in interface FluentCollectionX<T>minus in interface LazyCollectionX<T>minus in interface BagX<T>minus in interface org.pcollections.PBag<T>minus in interface org.pcollections.PCollection<T>remove - Element to removepublic <U> LazyPBagX<U> unitIterator(java.util.Iterator<U> it)
Traversable
ReactiveSeq<Integer> newSeq = seq.unitIterable(myIterator);
unitIterator in interface Traversable<T>unitIterator in interface BagX<T>it - Iterator to create new IterableFunctor frompublic <R> LazyPBagX<R> unit(java.util.Collection<R> col)
FluentCollectionX