public static final class BankersQueue.Cons<T> extends java.lang.Object implements BankersQueue<T>, ImmutableQueue.Some<T>
BankersQueue.Cons<T>, BankersQueue.Nil<T>
Deconstruct.Deconstruct1<T1>, Deconstruct.Deconstruct2<T1,T2>, Deconstruct.Deconstruct3<T1,T2,T3>, Deconstruct.Deconstruct4<T1,T2,T3,T4>, Deconstruct.Deconstruct5<T1,T2,T3,T4,T5>
ImmutableQueue.None<T>, ImmutableQueue.Some<T>
Modifier and Type | Method and Description |
---|---|
<R> BankersQueue<R> |
concatMap(java.util.function.Function<? super T,? extends java.lang.Iterable<? extends R>> fn)
Perform a flatMap operation on this IterableX.
|
Tuple2<T,BankersQueue<T>> |
dequeue() |
BankersQueue<T> |
enqueue(T value) |
boolean |
equals(java.lang.Object obj) |
<R> BankersQueue<R> |
flatMap(java.util.function.Function<? super T,? extends ImmutableQueue<? extends R>> fn) |
<R> R |
fold(java.util.function.Function<? super ImmutableQueue.Some<T>,? extends R> fn1,
java.util.function.Function<? super ImmutableQueue.None<T>,? extends R> fn2) |
<R> R |
foldBankersQueue(java.util.function.Function<? super BankersQueue.Cons<T>,? extends R> fn1,
java.util.function.Function<? super BankersQueue.Nil<T>,? extends R> fn2) |
Option<T> |
get(int n) |
T |
getOrElse(int n,
T alt) |
T |
getOrElseGet(int n,
java.util.function.Supplier<? extends T> alt) |
int |
hashCode() |
T |
head() |
boolean |
isEmpty() |
LazySeq<T> |
lazySeq() |
<R> BankersQueue<R> |
map(java.util.function.Function<? super T,? extends R> map)
Transform this functor using the supplied transformation function
|
<R> BankersQueue<R> |
mergeMap(java.util.function.Function<? super T,? extends org.reactivestreams.Publisher<? extends R>> fn) |
<R> BankersQueue<R> |
mergeMap(int maxConcurecy,
java.util.function.Function<? super T,? extends org.reactivestreams.Publisher<? extends R>> fn) |
ImmutableQueue<T> |
onEmpty(T value)
If this Container instance is zero, create a new instance containing the provided value
|
ImmutableQueue<T> |
onEmptyGet(java.util.function.Supplier<? extends T> supplier)
If this Container instance is zero, create a new instance containing the value returned from the provided Supplier
|
ImmutableQueue<T> |
onEmptySwitch(java.util.function.Supplier<? extends ImmutableQueue<T>> supplier)
Switch to container created by provided Supplier, if current Container zero
|
BankersQueue<T> |
prepend(T value) |
BankersQueue<T> |
replace(T currentElement,
T newElement) |
int |
size() |
BankersQueue<T> |
tail() |
java.lang.String |
toString() |
Tuple2<T,ImmutableQueue<T>> |
unapply() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
append, appendAll, appendAll, collector, combinations, combinations, combine, combine, cons, containsValue, cycle, cycle, cycleUntil, cycleWhile, deleteBetween, dequeue, distinct, drop, dropRight, dropUntil, dropWhile, duplicate, empty, emptyUnit, filter, filterNot, foldLeft, forEach2, forEach2, forEach3, forEach3, forEach4, forEach4, fromIterable, fromIterator, fromStream, grouped, grouped, groupedUntil, groupedUntil, groupedUntil, groupedWhile, groupedWhile, insertAt, insertAt, insertAt, insertStreamAt, intersperse, iterator, minus, mkString, notNull, of, ofAll, ofType, peek, permutations, plus, plusAll, prependAll, prependAll, prependStream, removeAll, removeAll, removeAt, removeFirst, removeStream, removeValue, retainAll, retainAll, retainStream, reverse, scanLeft, scanLeft, scanRight, scanRight, shuffle, shuffle, slice, sliding, sliding, sorted, sorted, sorted, stream, take, takeRight, takeUntil, takeWhile, unitIterable, unitStream, unzip, updateAt, zip, zip, zip, zip3, zip3, zip4, zip4, zipWithIndex, zipWithPublisher, zipWithStream, zipWithStream
fold
focusAt, focusAt, imSeq, onEmptyTry, partition, span, splitAt, splitBy, subList, traversable
asFunction, equalToIteration, foldFuture, foldLazy, foldTry, forEach, forEach, forEach, forEach, forEach, forEachSubscribe, forEachSubscribe, forEachSubscribe, runFuture, runLazy, seq, to, toHashSet
fixedDelay, insertAt, onePer, subscribe, xPer
allMatch, anyMatch, atPercentile, bankersQueue, collect, collect, collect, collect, count, countDistinct, doubleStats, elementAt, endsWith, firstValue, foldLeft, foldLeft, foldLeft, foldLeft, foldLeft, foldMap, foldMap, foldMapRight, foldRight, foldRight, foldRight, groupBy, hashSet, headOption, indexOf, indexOfSlice, intStats, iterableTo, join, join, join, lastIndexOf, lastIndexOfSlice, longStats, maxBy, maxBy, maximum, mean, median, minBy, minBy, minimum, mode, noneMatch, nonEmptyList, occurances, populationVariance, print, print, printErr, printOut, scheduleStream, single, single, singleOrElse, startsWith, stdDeviation, sumDouble, sumInt, sumLong, takeOne, toArray, toArray, toCollection, toHashMap, toHashMap, toList, toMap, toMap, toSet, treeSet, variance, vector, withPercentiles, xMatch
queueView
public int size()
size
in interface PersistentCollection<T>
size
in interface IterableX<T>
size
in interface BankersQueue<T>
size
in interface ImmutableQueue<T>
public boolean isEmpty()
isEmpty
in interface PersistentCollection<T>
isEmpty
in interface IterableX<T>
isEmpty
in interface BankersQueue<T>
isEmpty
in interface ImmutableQueue<T>
public BankersQueue<T> enqueue(T value)
enqueue
in interface BankersQueue<T>
public <R> BankersQueue<R> map(java.util.function.Function<? super T,? extends R> map)
Transformable
of(1,2,3).map(i->i*2)
//[2,4,6]
map
in interface FilterableTransformable<T>
map
in interface Transformable<T>
map
in interface IterableX<T>
map
in interface Traversable<T>
map
in interface BankersQueue<T>
map
in interface ImmutableQueue<T>
map
- Transformation functionpublic <R> BankersQueue<R> flatMap(java.util.function.Function<? super T,? extends ImmutableQueue<? extends R>> fn)
flatMap
in interface BankersQueue<T>
flatMap
in interface ImmutableQueue<T>
public <R> BankersQueue<R> concatMap(java.util.function.Function<? super T,? extends java.lang.Iterable<? extends R>> fn)
IterableX
concatMap
in interface IterableX<T>
concatMap
in interface BankersQueue<T>
concatMap
in interface ImmutableQueue<T>
fn
- Transformation function to be applied (and flattened)public <R> BankersQueue<R> mergeMap(java.util.function.Function<? super T,? extends org.reactivestreams.Publisher<? extends R>> fn)
mergeMap
in interface IterableX<T>
mergeMap
in interface BankersQueue<T>
mergeMap
in interface ImmutableQueue<T>
public <R> BankersQueue<R> mergeMap(int maxConcurecy, java.util.function.Function<? super T,? extends org.reactivestreams.Publisher<? extends R>> fn)
mergeMap
in interface IterableX<T>
mergeMap
in interface BankersQueue<T>
mergeMap
in interface ImmutableQueue<T>
public <R> R fold(java.util.function.Function<? super ImmutableQueue.Some<T>,? extends R> fn1, java.util.function.Function<? super ImmutableQueue.None<T>,? extends R> fn2)
fold
in interface Sealed2<ImmutableQueue.Some<T>,ImmutableQueue.None<T>>
fold
in interface ImmutableQueue<T>
fold
in interface ImmutableQueue.Some<T>
public <R> R foldBankersQueue(java.util.function.Function<? super BankersQueue.Cons<T>,? extends R> fn1, java.util.function.Function<? super BankersQueue.Nil<T>,? extends R> fn2)
foldBankersQueue
in interface BankersQueue<T>
public ImmutableQueue<T> onEmpty(T value)
OnEmpty
public ImmutableQueue<T> onEmptyGet(java.util.function.Supplier<? extends T> supplier)
OnEmpty
onEmptyGet
in interface OnEmpty<T>
onEmptyGet
in interface IterableX<T>
onEmptyGet
in interface Traversable<T>
onEmptyGet
in interface ImmutableQueue<T>
supplier
- to determine new value for containerpublic ImmutableQueue<T> onEmptySwitch(java.util.function.Supplier<? extends ImmutableQueue<T>> supplier)
OnEmptySwitch
Seq.zero().onEmptySwitch(()->Seq.of(1));
onEmptySwitch
in interface OnEmptySwitch<ImmutableQueue<T>,ImmutableQueue<T>>
onEmptySwitch
in interface ImmutableQueue<T>
supplier
- to create replacement containerpublic Tuple2<T,BankersQueue<T>> dequeue()
public T head()
head
in interface ImmutableQueue.Some<T>
public BankersQueue<T> tail()
tail
in interface BankersQueue<T>
tail
in interface ImmutableQueue.Some<T>
public BankersQueue<T> replace(T currentElement, T newElement)
replace
in interface BankersQueue<T>
replace
in interface ImmutableQueue<T>
public Option<T> get(int n)
get
in interface PersistentIndexed<T>
get
in interface BankersQueue<T>
get
in interface ImmutableQueue<T>
public T getOrElse(int n, T alt)
getOrElse
in interface PersistentIndexed<T>
getOrElse
in interface ImmutableQueue<T>
public T getOrElseGet(int n, java.util.function.Supplier<? extends T> alt)
getOrElseGet
in interface PersistentIndexed<T>
getOrElseGet
in interface ImmutableQueue<T>
public LazySeq<T> lazySeq()
lazySeq
in interface Folds<T>
lazySeq
in interface BankersQueue<T>
lazySeq
in interface ImmutableQueue<T>
public BankersQueue<T> prepend(T value)
prepend
in interface IterableX<T>
prepend
in interface Traversable<T>
prepend
in interface BankersQueue<T>
prepend
in interface ImmutableQueue<T>
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public Tuple2<T,ImmutableQueue<T>> unapply()
unapply
in interface Deconstruct<Tuple2<T,ImmutableQueue<T>>>