T
- the type of elements held in this collectionpublic class LazyDequeX<T> extends AbstractLazyCollection<T,java.util.Deque<T>> implements DequeX<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 toNested 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.DequeX.µ, DequeX.Instances
Constructor and Description |
---|
LazyDequeX(java.util.Deque<T> list,
java.util.stream.Collector<T,?,java.util.Deque<T>> collector) |
LazyDequeX(java.util.Deque<T> list,
ReactiveSeq<T> seq,
java.util.stream.Collector<T,?,java.util.Deque<T>> collector) |
LazyDequeX(ReactiveSeq<T> seq,
java.util.stream.Collector<T,?,java.util.Deque<T>> collector) |
Modifier and Type | Method and Description |
---|---|
void |
addFirst(T t) |
void |
addLast(T t) |
java.util.Iterator<T> |
descendingIterator() |
T |
element() |
<T1> LazyDequeX<T1> |
from(java.util.Collection<T1> c)
Conctruct an Extended Collection from a standard Collection
|
<X> LazyDequeX<X> |
fromStream(ReactiveSeq<X> stream) |
<T1> java.util.stream.Collector<T1,?,java.util.Deque<T1>> |
getCollector() |
T |
getFirst() |
T |
getLast() |
DequeX<T> |
materialize() |
boolean |
offer(T t) |
boolean |
offerFirst(T t) |
boolean |
offerLast(T t) |
T |
peek() |
T |
peekFirst() |
T |
peekLast() |
T |
poll() |
T |
pollFirst() |
T |
pollLast() |
T |
pop() |
void |
push(T t) |
T |
remove() |
T |
removeFirst() |
boolean |
removeFirstOccurrence(java.lang.Object o) |
T |
removeLast() |
boolean |
removeLastOccurrence(java.lang.Object o) |
LazyDequeX<T> |
type(java.util.stream.Collector<T,?,java.util.Deque<T>> collector) |
<R> LazyDequeX<R> |
unit(java.util.Collection<R> col)
Create a new instance of the same colleciton type from the supplied collection
|
<U> LazyDequeX<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, unwrap
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
anyM, append, append, cast, coflatMap, combinations, combinations, combine, combine, cycle, cycle, cycleUntil, cycleWhile, defaultCollector, deleteBetween, dequeX, distinct, drop, dropRight, dropUntil, dropWhile, empty, fill, 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, insertAt, insertAtS, intersperse, iterate, limit, limitLast, limitUntil, limitWhile, map, minus, minusAll, narrow, narrowK, notNull, of, ofType, onEmpty, onEmptyGet, onEmptySwitch, onEmptyThrow, peek, permutations, plus, plusAll, plusLoop, plusLoop, 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, take, takeRight, takeUntil, takeWhile, trampoline, unfold, unit, widen2, zip, zip, zip3, zip4, zipS, zipS, zipWithIndex
reduce
plusInOrder
collection, findAny, findFirst, fromCollection, getAtIndex, groupBy, head, headAndTail, isEmpty, materializeReversed, single, single, singleOptional
asFunction, foldFuture, foldLazy, foldTry, forEach, forEach, forEach, forEach, forEach, forEachSubscribe, forEachSubscribe, forEachSubscribe, runFuture, runLazy, seq, toListX, toSetX, visit
allMatch, 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, 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, xMatch
mapToDouble, mapToInt, mapToLong, subscribe, traversable
zip, zip3, zip4, zipP, zipP, zipWith, zipWithP, zipWithS
groupedStatefullyUntilT, groupedT, groupedUntilT, groupedWhileT, slidingT, slidingT
fixedDelay, onePer, xPer
addAll, clear, containsAll, equals, hashCode, parallelStream, removeAll, removeIf, retainAll, spliterator, toArray, toArray
unwrap, unwrapIfInstance, unwrapNested
public LazyDequeX(java.util.Deque<T> list, ReactiveSeq<T> seq, java.util.stream.Collector<T,?,java.util.Deque<T>> collector)
public LazyDequeX(java.util.Deque<T> list, java.util.stream.Collector<T,?,java.util.Deque<T>> collector)
public LazyDequeX(ReactiveSeq<T> seq, java.util.stream.Collector<T,?,java.util.Deque<T>> collector)
public LazyDequeX<T> type(java.util.stream.Collector<T,?,java.util.Deque<T>> collector)
public DequeX<T> materialize()
materialize
in interface CollectionX<T>
materialize
in interface DequeX<T>
materialize
in class AbstractLazyCollection<T,java.util.Deque<T>>
public <T1> java.util.stream.Collector<T1,?,java.util.Deque<T1>> getCollector()
getCollector
in interface DequeX<T>
public <X> LazyDequeX<X> fromStream(ReactiveSeq<X> stream)
fromStream
in interface LazyCollectionX<T>
fromStream
in interface DequeX<T>
stream
- Create a MultableCollectionX from a Streampublic <T1> LazyDequeX<T1> from(java.util.Collection<T1> c)
CollectionX
public <U> LazyDequeX<U> unitIterator(java.util.Iterator<U> it)
Traversable
ReactiveSeq<Integer> newSeq = seq.unitIterable(myIterator);
unitIterator
in interface Traversable<T>
unitIterator
in interface DequeX<T>
it
- Iterator toNested create new IterableFunctor frompublic <R> LazyDequeX<R> unit(java.util.Collection<R> col)
FluentCollectionX
public boolean removeFirstOccurrence(java.lang.Object o)
removeFirstOccurrence
in interface java.util.Deque<T>
public boolean removeLastOccurrence(java.lang.Object o)
removeLastOccurrence
in interface java.util.Deque<T>
public boolean offer(T t)
public T remove()
public T poll()
public T element()
public T peek()