T
- the type of elements held in this collectionpublic class LazyPVectorX<T> extends AbstractLazyPersistentCollection<T,org.pcollections.PVector<T>> implements PVectorX<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.PVectorX.µ, PVectorX.Instances
Fn1.FunctionalOperations<T1,R>
list, seq
Constructor and Description |
---|
LazyPVectorX(org.pcollections.PVector<T> list) |
LazyPVectorX(org.pcollections.PVector<T> list,
ReactiveSeq<T> seq) |
LazyPVectorX(ReactiveSeq<T> seq) |
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
T element) |
boolean |
addAll(int index,
java.util.Collection<? extends T> c) |
int |
compareTo(T o) |
<T1> LazyPVectorX<T1> |
from(java.util.Collection<T1> c)
Conctruct an Extended Collection from a standard Collection
|
T |
get(int index) |
int |
indexOf(java.lang.Object o) |
int |
lastIndexOf(java.lang.Object o) |
java.util.ListIterator<T> |
listIterator() |
java.util.ListIterator<T> |
listIterator(int index) |
PVectorX<T> |
materialize() |
PVectorX<T> |
minus(int i)
Remove the element at the supplied index
|
PVectorX<T> |
minus(java.lang.Object remove)
Remove the specified element from this collection
|
PVectorX<T> |
minusAll(java.util.Collection<?> list)
Remove all the specified elements from this collection
|
PVectorX<T> |
plus(int i,
T e)
Add the supplied element at the supplied index
|
PVectorX<T> |
plus(T e)
Add an element to this Collection
|
PVectorX<T> |
plusAll(java.util.Collection<? extends T> list)
Add all supplied elements to this Collection
|
PVectorX<T> |
plusAll(int i,
java.util.Collection<? extends T> list)
Add all of the supplied elements at the supplied index
|
PVectorX<T> |
plusLoop(int max,
java.util.function.IntFunction<T> value) |
PVectorX<T> |
plusLoop(java.util.function.Supplier<java.util.Optional<T>> supplier) |
T |
remove(int index) |
T |
set(int index,
T element) |
PVectorX<T> |
subList(int start,
int end)
Create a sub sequence between the two supplied index
|
<R> LazyPVectorX<R> |
unit(java.util.Collection<R> col)
Create a new instance of the same colleciton type from the supplied collection
|
<U> LazyPVectorX<U> |
unitIterator(java.util.Iterator<U> it)
Create an IterableFunctor instance of the same type from an Iterator
|
PVectorX<T> |
with(int i,
T e)
Replace the value at the specifed index with the supplied value
|
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, fill, filter, filterNot, flatMap, flatMapP, flatMapS, forEach2, forEach2, forEach3, forEach3, forEach4, forEach4, fromCollection, fromIterable, fromIterator, fromPublisher, fromStream, generate, grouped, grouped, grouped, grouped, groupedStatefullyUntil, groupedUntil, groupedUntil, groupedWhile, groupedWhile, insertAt, insertAtS, intersperse, iterate, liftM, limit, limitLast, limitUntil, limitWhile, map, monoid, narrow, narrowK, 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, take, takeRight, takeUntil, takeWhile, toPVector, toPVectorX, trampoline, unfold, unit, widen2, zip, zip, zip3, zip4, zipS, zipS, zipWithIndex
add, addAll, clear, remove, removeAll, retainAll
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, replaceAll, retainAll, size, sort, spliterator, toArray, toArray
stream
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, toPQueueX, toPSetX, toPStackX, toQueueX, toSetX, toSimpleReact, toSimpleReact, toSortedSetX, toStreamable, toValue
public LazyPVectorX(org.pcollections.PVector<T> list, ReactiveSeq<T> seq)
public LazyPVectorX(org.pcollections.PVector<T> list)
public LazyPVectorX(ReactiveSeq<T> seq)
public PVectorX<T> materialize()
materialize
in interface CollectionX<T>
materialize
in interface PVectorX<T>
public <T1> LazyPVectorX<T1> from(java.util.Collection<T1> c)
CollectionX
from
in interface CollectionX<T>
from
in interface PersistentCollectionX<T>
from
in interface PVectorX<T>
c
- Collection to extendpublic PVectorX<T> minusAll(java.util.Collection<?> list)
FluentCollectionX
minusAll
in interface FluentCollectionX<T>
minusAll
in interface FluentSequenceX<T>
minusAll
in interface PVectorX<T>
minusAll
in interface org.pcollections.PCollection<T>
minusAll
in interface org.pcollections.PSequence<T>
minusAll
in interface org.pcollections.PVector<T>
list
- of elements to removepublic PVectorX<T> minus(java.lang.Object remove)
FluentCollectionX
minus
in interface FluentCollectionX<T>
minus
in interface FluentSequenceX<T>
minus
in interface PVectorX<T>
minus
in interface org.pcollections.PCollection<T>
minus
in interface org.pcollections.PSequence<T>
minus
in interface org.pcollections.PVector<T>
remove
- Element to removepublic PVectorX<T> with(int i, T e)
FluentSequenceX
with
in interface FluentSequenceX<T>
with
in interface PVectorX<T>
with
in interface org.pcollections.PSequence<T>
with
in interface org.pcollections.PVector<T>
i
- Index to replace value ate
- Value to usepublic PVectorX<T> plus(int i, T e)
FluentSequenceX
plus
in interface FluentSequenceX<T>
plus
in interface PVectorX<T>
plus
in interface org.pcollections.PSequence<T>
plus
in interface org.pcollections.PVector<T>
i
- Index to add element ate
- Element to addpublic PVectorX<T> plus(T e)
FluentCollectionX
plus
in interface FluentCollectionX<T>
plus
in interface FluentSequenceX<T>
plus
in interface PVectorX<T>
plus
in interface org.pcollections.PCollection<T>
plus
in interface org.pcollections.PSequence<T>
plus
in interface org.pcollections.PVector<T>
e
- Element to addpublic PVectorX<T> plusAll(java.util.Collection<? extends T> list)
FluentCollectionX
plusAll
in interface FluentCollectionX<T>
plusAll
in interface FluentSequenceX<T>
plusAll
in interface PVectorX<T>
plusAll
in interface org.pcollections.PCollection<T>
plusAll
in interface org.pcollections.PSequence<T>
plusAll
in interface org.pcollections.PVector<T>
list
- of elements to addpublic PVectorX<T> plusAll(int i, java.util.Collection<? extends T> list)
FluentSequenceX
plusAll
in interface FluentSequenceX<T>
plusAll
in interface PVectorX<T>
plusAll
in interface org.pcollections.PSequence<T>
plusAll
in interface org.pcollections.PVector<T>
i
- Index to add element atlist
- Collection of elements to addpublic PVectorX<T> minus(int i)
FluentSequenceX
minus
in interface FluentSequenceX<T>
minus
in interface PVectorX<T>
minus
in interface org.pcollections.PSequence<T>
minus
in interface org.pcollections.PVector<T>
i
- Index at which to remvoe elementpublic PVectorX<T> subList(int start, int end)
FluentSequenceX
subList
in interface FluentSequenceX<T>
subList
in interface PVectorX<T>
subList
in interface java.util.List<T>
subList
in interface org.pcollections.PSequence<T>
subList
in interface org.pcollections.PVector<T>
start
- Index of our sub sequence (inclusive)end
- Index of our sub sequence (exclusive)public boolean addAll(int index, java.util.Collection<? extends T> c)
public void add(int index, T element)
public T remove(int index)
public int indexOf(java.lang.Object o)
indexOf
in interface java.util.List<T>
public int lastIndexOf(java.lang.Object o)
lastIndexOf
in interface java.util.List<T>
public java.util.ListIterator<T> listIterator()
listIterator
in interface java.util.List<T>
public java.util.ListIterator<T> listIterator(int index)
listIterator
in interface java.util.List<T>
public <U> LazyPVectorX<U> unitIterator(java.util.Iterator<U> it)
Traversable
ReactiveSeq<Integer> newSeq = seq.unitIterable(myIterator);
unitIterator
in interface Traversable<T>
unitIterator
in interface PVectorX<T>
it
- Iterator to create new IterableFunctor frompublic <R> LazyPVectorX<R> unit(java.util.Collection<R> col)
FluentCollectionX
unit
in interface FluentCollectionX<T>
unit
in interface PersistentCollectionX<T>
unit
in interface PVectorX<T>
col
- Collection data to populate the new collectionpublic PVectorX<T> plusLoop(int max, java.util.function.IntFunction<T> value)
plusLoop
in interface FluentCollectionX<T>
plusLoop
in interface PVectorX<T>
plusLoop
in class AbstractLazyPersistentCollection<T,org.pcollections.PVector<T>>