T
- the type of elements held in this collectionpublic class LazySetX<T> extends AbstractLazyMutableCollection<T,java.util.Set<T>> implements SetX<T>
List
Extended Set operations execute lazily e.g.
SetX<Integer> q = SetX.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.
SetX<Integer> q = SetX.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>
Constructor and Description |
---|
LazySetX(ReactiveSeq<T> seq,
java.util.stream.Collector<T,?,java.util.Set<T>> collector) |
LazySetX(java.util.Set<T> list,
java.util.stream.Collector<T,?,java.util.Set<T>> collector) |
LazySetX(java.util.Set<T> list,
ReactiveSeq<T> seq,
java.util.stream.Collector<T,?,java.util.Set<T>> collector) |
Modifier and Type | Method and Description |
---|---|
<T1> LazySetX<T1> |
from(java.util.Collection<T1> c)
Conctruct an Extended Collection from a standard Collection
|
<X> LazySetX<X> |
fromStream(java.util.stream.Stream<X> stream) |
<T1> java.util.stream.Collector<T1,?,java.util.Set<T1>> |
getCollector() |
SetX<T> |
materialize() |
<R> LazySetX<R> |
unit(java.util.Collection<R> col)
Create a new instance of the same colleciton type from the supplied collection
|
<U> LazySetX<U> |
unitIterator(java.util.Iterator<U> it)
Create an IterableFunctor instance of the same type from an Iterator
|
LazySetX<T> |
withCollector(java.util.stream.Collector<T,?,java.util.Set<T>> collector) |
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, combine, cycle, cycle, cycleUntil, cycleWhile, defaultCollector, deleteBetween, distinct, drop, dropRight, dropUntil, dropWhile, empty, filter, filterNot, flatMap, flatMapP, flatMapS, forEach2, forEach2, forEach3, forEach3, forEach4, forEach4, fromIterable, fromIterable, fromIterator, fromPublisher, generate, grouped, grouped, grouped, grouped, groupedStatefullyUntil, groupedUntil, groupedUntil, groupedWhile, groupedWhile, immutableCollector, insertAt, insertAtS, intersperse, iterate, limit, limitLast, limitUntil, limitWhile, map, minus, minusAll, narrow, notNull, of, ofType, onEmpty, onEmptyGet, onEmptySwitch, onEmptyThrow, plus, plusAll, plusLoop, plusLoop, prepend, prepend, prependS, range, rangeLong, recover, recover, removeAllS, removeAllS, removeAllS, retainAllS, retainAllS, retainAllS, retry, retry, reverse, scanLeft, scanLeft, scanRight, scanRight, setXCollector, shuffle, shuffle, singleton, skip, skipLast, skipUntil, skipWhile, slice, sliding, sliding, sorted, sorted, sorted, stream, take, takeRight, takeUntil, takeWhile, toSetX, trampoline, unfold, unit, zip, zip, zip3, zip4, zipS, zipS, zipWithIndex
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, spliterator, toArray, toArray
combinations, combinations, permutations, reduce
plusInOrder
findAny, findFirst, fromCollection, 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, schedule, scheduleFixedDelay, scheduleFixedRate, startsWith, startsWithIterable, toConcurrentLazyCollection, toConcurrentLazyStreamable, toLazyCollection, xMatch
toDequeX, toFutureStream, toFutureStream, toListX, toMapX, toOptional, toPBagX, toPMapX, toPOrderedSetX, toPQueueX, toPSetX, toPStackX, toPVectorX, toQueueX, 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 LazySetX(java.util.Set<T> list, ReactiveSeq<T> seq, java.util.stream.Collector<T,?,java.util.Set<T>> collector)
public LazySetX(java.util.Set<T> list, java.util.stream.Collector<T,?,java.util.Set<T>> collector)
public LazySetX(ReactiveSeq<T> seq, java.util.stream.Collector<T,?,java.util.Set<T>> collector)
public LazySetX<T> withCollector(java.util.stream.Collector<T,?,java.util.Set<T>> collector)
withCollector
in interface SetX<T>
public SetX<T> materialize()
materialize
in interface CollectionX<T>
materialize
in interface SetX<T>
materialize
in class AbstractLazyMutableCollection<T,java.util.Set<T>>
public <T1> java.util.stream.Collector<T1,?,java.util.Set<T1>> getCollector()
getCollector
in interface SetX<T>
public <X> LazySetX<X> fromStream(java.util.stream.Stream<X> stream)
fromStream
in interface MutableCollectionX<T>
fromStream
in interface SetX<T>
stream
- Create a MultableCollectionX from a Streampublic <T1> LazySetX<T1> from(java.util.Collection<T1> c)
CollectionX
public <U> LazySetX<U> unitIterator(java.util.Iterator<U> it)
Traversable
ReactiveSeq<Integer> newSeq = seq.unitIterable(myIterator);
unitIterator
in interface Traversable<T>
unitIterator
in interface SetX<T>
it
- Iterator to create new IterableFunctor frompublic <R> LazySetX<R> unit(java.util.Collection<R> col)
FluentCollectionX