- java.lang.Object
-
- org.jooq.lambda.WindowImpl<T>
-
- All Implemented Interfaces:
Collectable<T>
,Window<T>
class WindowImpl<T> extends java.lang.Object implements Window<T>
-
-
Constructor Summary
Constructors Constructor Description WindowImpl(Tuple2<T,java.lang.Long> value, Partition<T> partition, WindowSpecification<T> specification)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
allMatch(java.util.function.Predicate<? super T> predicate)
Whether all elements in the collectable match a given predicate.boolean
anyMatch(java.util.function.Predicate<? super T> predicate)
Whether any element in the collectable matches a given predicate.java.util.Optional<T>
avg()
Get the average of the elements in this collectable.<U> java.util.Optional<U>
avg(java.util.function.Function<? super T,? extends U> function)
Get the average of the elements in this collectable.double
avgDouble(java.util.function.ToDoubleFunction<? super T> function)
Get the average of the elements in this collectable asdouble
.double
avgInt(java.util.function.ToIntFunction<? super T> function)
Get the average of the elements in this collectable asint
.double
avgLong(java.util.function.ToLongFunction<? super T> function)
Get the average of the elements in this collectable aslong
.java.util.Optional<T>
bitAnd()
Collect all bits in this stream into a single value by applying bitwise and.<U> java.util.Optional<U>
bitAnd(java.util.function.Function<? super T,? extends U> function)
Collect all bits in this stream into a single value by applying bitwise and.int
bitAndInt(java.util.function.ToIntFunction<? super T> function)
Collect all bits in this stream into a single value by applying bitwise and.long
bitAndLong(java.util.function.ToLongFunction<? super T> function)
Collect all bits in this stream into a single value by applying bitwise and.java.util.Optional<T>
bitOr()
Collect all bits in this stream into a single value by applying bitwise or.<U> java.util.Optional<U>
bitOr(java.util.function.Function<? super T,? extends U> function)
Collect all bits in this stream into a single value by applying bitwise or.int
bitOrInt(java.util.function.ToIntFunction<? super T> function)
Collect all bits in this stream into a single value by applying bitwise or.long
bitOrLong(java.util.function.ToLongFunction<? super T> function)
Collect all bits in this stream into a single value by applying bitwise or.<R,A>
Rcollect(java.util.stream.Collector<? super T,A,R> collector)
Collect this collectable.java.lang.String
commonPrefix()
Get the common prefix of all strings (or to-stringed values) in this stream.java.lang.String
commonSuffix()
Get the common prefix of all strings (or to-stringed values) in this stream.private boolean
completePartition()
long
count()
Count the values in this collectable.long
count(java.util.function.Predicate<? super T> predicate)
Count the values in this collectable, for which a predicate evaluates to true.long
countDistinct()
Count the distinct values in this collectable.long
countDistinct(java.util.function.Predicate<? super T> predicate)
Count the distinct values in this collectable, for which a predicate evaluates to true.<U> long
countDistinctBy(java.util.function.Function<? super T,? extends U> function)
Count the distinct values of a given expression in this collectable.<U> long
countDistinctBy(java.util.function.Function<? super T,? extends U> function, java.util.function.Predicate<? super U> predicate)
Count the distinct values of a given expression in this collectable, for which a predicate evaluates to true.long
denseRank()
The dense rank of the current row within the partition.java.util.Optional<T>
firstValue()
The first value in the window.<U> java.util.Optional<U>
firstValue(java.util.function.Function<? super T,? extends U> function)
The first value in the window.java.util.Optional<T>
lag()
The previous value in the window.java.util.Optional<T>
lag(long lag)
The previous value bylag
in the window.java.util.Optional<T>
lastValue()
The last value in the window.<U> java.util.Optional<U>
lastValue(java.util.function.Function<? super T,? extends U> function)
The last value in the window.java.util.Optional<T>
lead()
The next value in the window.java.util.Optional<T>
lead(long lead)
The next value bylead
in the window.private java.util.Optional<T>
lead0(long lead)
private int
lower()
private boolean
lowerInPartition()
java.util.Optional<T>
max()
Get the maximum value.java.util.Optional<T>
max(java.util.Comparator<? super T> comparator)
Get the maximum value by a function.<U extends java.lang.Comparable<? super U>>
java.util.Optional<U>max(java.util.function.Function<? super T,? extends U> function)
Get the maximum value by a function.<U> java.util.Optional<U>
max(java.util.function.Function<? super T,? extends U> function, java.util.Comparator<? super U> comparator)
Get the maximum value by a function.Seq<T>
maxAll()
Get the maximum values.Seq<T>
maxAll(java.util.Comparator<? super T> comparator)
Get the maximum values by a function.<U extends java.lang.Comparable<? super U>>
Seq<U>maxAll(java.util.function.Function<? super T,? extends U> function)
Get the maximum values by a function.<U> Seq<U>
maxAll(java.util.function.Function<? super T,? extends U> function, java.util.Comparator<? super U> comparator)
Get the maximum values by a function.<U extends java.lang.Comparable<? super U>>
Seq<T>maxAllBy(java.util.function.Function<? super T,? extends U> function)
Get the maximum values by a function.<U> Seq<T>
maxAllBy(java.util.function.Function<? super T,? extends U> function, java.util.Comparator<? super U> comparator)
Get the maximum values by a function.<U extends java.lang.Comparable<? super U>>
java.util.Optional<T>maxBy(java.util.function.Function<? super T,? extends U> function)
Get the maximum value by a function.<U> java.util.Optional<T>
maxBy(java.util.function.Function<? super T,? extends U> function, java.util.Comparator<? super U> comparator)
Get the maximum value by a function.java.util.Optional<T>
median()
Get the median value.java.util.Optional<T>
median(java.util.Comparator<? super T> comparator)
Get the median value.<U extends java.lang.Comparable<? super U>>
java.util.Optional<T>medianBy(java.util.function.Function<? super T,? extends U> function)
Get the median value by a function.<U> java.util.Optional<T>
medianBy(java.util.function.Function<? super T,? extends U> function, java.util.Comparator<? super U> comparator)
Get the median value by a function.java.util.Optional<T>
min()
Get the minimum value.java.util.Optional<T>
min(java.util.Comparator<? super T> comparator)
Get the minimum value by a function.<U extends java.lang.Comparable<? super U>>
java.util.Optional<U>min(java.util.function.Function<? super T,? extends U> function)
Get the minimum value by a function.<U> java.util.Optional<U>
min(java.util.function.Function<? super T,? extends U> function, java.util.Comparator<? super U> comparator)
Get the minimum value by a function.Seq<T>
minAll()
Get the minimum values.Seq<T>
minAll(java.util.Comparator<? super T> comparator)
Get the minimum values by a function.<U extends java.lang.Comparable<? super U>>
Seq<U>minAll(java.util.function.Function<? super T,? extends U> function)
Get the minimum values by a function.<U> Seq<U>
minAll(java.util.function.Function<? super T,? extends U> function, java.util.Comparator<? super U> comparator)
Get the minimum values by a function.<U extends java.lang.Comparable<? super U>>
Seq<T>minAllBy(java.util.function.Function<? super T,? extends U> function)
Get the minimum values by a function.<U> Seq<T>
minAllBy(java.util.function.Function<? super T,? extends U> function, java.util.Comparator<? super U> comparator)
Get the minimum values by a function.<U extends java.lang.Comparable<? super U>>
java.util.Optional<T>minBy(java.util.function.Function<? super T,? extends U> function)
Get the minimum value by a function.<U> java.util.Optional<T>
minBy(java.util.function.Function<? super T,? extends U> function, java.util.Comparator<? super U> comparator)
Get the minimum value by a function.java.util.Optional<T>
mode()
Get the mode, i.e.Seq<T>
modeAll()
Get the mode, i.e.<U> Seq<T>
modeAllBy(java.util.function.Function<? super T,? extends U> function)
Get the mode, i.e.<U> java.util.Optional<T>
modeBy(java.util.function.Function<? super T,? extends U> function)
Get the mode, i.e.boolean
noneMatch(java.util.function.Predicate<? super T> predicate)
Whether no element in the collectable matches a given predicate.java.util.Optional<T>
nthValue(long n)
The nth value in the window.<U> java.util.Optional<U>
nthValue(long n, java.util.function.Function<? super T,? extends U> function)
The nth value in the window.long
ntile(long bucket)
The bucket number ("ntile") of the current row within the partition.java.util.Optional<T>
percentile(double percentile)
Get the discrete percentile value.java.util.Optional<T>
percentile(double percentile, java.util.Comparator<? super T> comparator)
Get the discrete percentile value.<U extends java.lang.Comparable<? super U>>
java.util.Optional<T>percentileBy(double percentile, java.util.function.Function<? super T,? extends U> function)
Get the discrete percentile value by a function.<U> java.util.Optional<T>
percentileBy(double percentile, java.util.function.Function<? super T,? extends U> function, java.util.Comparator<? super U> comparator)
Get the discrete percentile value by a function.double
percentRank()
The precent rank of the current row within the partition.long
rank()
The rank of the current row within the partition.long
rowNumber()
The row number of the current row within the partition.java.util.Optional<T>
sum()
Get the sum of the elements in this collectable.<U> java.util.Optional<U>
sum(java.util.function.Function<? super T,? extends U> function)
Get the sum of the elements in this collectable.double
sumDouble(java.util.function.ToDoubleFunction<? super T> function)
Get the sum of the elements in this collectable asdouble
.int
sumInt(java.util.function.ToIntFunction<? super T> function)
Get the sum of the elements in this collectable asint
.long
sumLong(java.util.function.ToLongFunction<? super T> function)
Get the sum of the elements in this collectable aslong
.<C extends java.util.Collection<T>>
CtoCollection(java.util.function.Supplier<C> factory)
Collect the collectable into aCollection
.java.util.List<T>
toList()
Collect the collectable into anArrayList
.<L extends java.util.List<T>>
LtoList(java.util.function.Supplier<L> factory)
Collect the collectable into aList
.<K> java.util.Map<K,T>
toMap(java.util.function.Function<? super T,? extends K> keyMapper)
Collect the collectable into aMap
with the given keys and the self element as value.<K,V>
java.util.Map<K,V>toMap(java.util.function.Function<? super T,? extends K> keyMapper, java.util.function.Function<? super T,? extends V> valueMapper)
Collect the collectable into aMap
.java.util.Set<T>
toSet()
Collect the collectable into aLinkedHashSet
.<S extends java.util.Set<T>>
StoSet(java.util.function.Supplier<S> factory)
Collect the collectable into aSet
.java.lang.String
toString()
java.lang.String
toString(java.lang.CharSequence delimiter)
Consume a stream and concatenate all elements using a separator.java.lang.String
toString(java.lang.CharSequence delimiter, java.lang.CharSequence prefix, java.lang.CharSequence suffix)
Shortcut for callingStream.collect(Collector)
with aCollectors.joining(CharSequence, CharSequence, CharSequence)
collector.java.util.List<T>
toUnmodifiableList()
Collect the collectable into an unmodifiableList
.java.util.Set<T>
toUnmodifiableSet()
Collect the collectable into an unmodifiableSet
.private int
upper()
private boolean
upperInPartition()
T
value()
The value of the current row in the window.Seq<T>
window()
Stream all elements in the window.
-
-
-
Method Detail
-
value
public T value()
Description copied from interface:Window
The value of the current row in the window.
-
window
public Seq<T> window()
Description copied from interface:Window
Stream all elements in the window.
-
lower
private int lower()
-
lowerInPartition
private boolean lowerInPartition()
-
upper
private int upper()
-
upperInPartition
private boolean upperInPartition()
-
completePartition
private boolean completePartition()
-
rowNumber
public long rowNumber()
Description copied from interface:Window
The row number of the current row within the partition.// (1, 2, 3, 4, 5) Seq.of(1, 2, 4, 2, 3).window().map(w -> w.rowNumber());
-
rank
public long rank()
Description copied from interface:Window
The rank of the current row within the partition.// (1, 2, 2, 4, 5) Seq.of(1, 2, 2, 3, 4).window(naturalOrder()).map(w -> w.rank());
-
denseRank
public long denseRank()
Description copied from interface:Window
The dense rank of the current row within the partition.// (1, 2, 2, 3, 4) Seq.of(1, 2, 2, 3, 4).window(naturalOrder()).map(w -> w.denseRank());
-
percentRank
public double percentRank()
Description copied from interface:Window
The precent rank of the current row within the partition.// (0.0, 0.25, 0.25, 0.75, 1.0) Seq.of(1, 2, 2, 3, 4).window(naturalOrder()).map(w -> w.percentRank());
- Specified by:
percentRank
in interfaceWindow<T>
-
ntile
public long ntile(long bucket)
Description copied from interface:Window
The bucket number ("ntile") of the current row within the partition.// (0, 0, 1, 1, 2) Seq.of(1, 2, 2, 3, 4).window(naturalOrder()).map(w -> w.ntile(3));
-
lead
public java.util.Optional<T> lead()
Description copied from interface:Window
The next value in the window.This is the same as calling
lead(1)
// (2, 2, 3, 4, empty) Seq.of(1, 2, 2, 3, 4).window().map(w -> w.lead());
-
lead
public java.util.Optional<T> lead(long lead)
Description copied from interface:Window
The next value bylead
in the window.// (2, 2, 3, 4, empty) Seq.of(1, 2, 2, 3, 4).window().map(w -> w.lead());
-
lag
public java.util.Optional<T> lag()
Description copied from interface:Window
The previous value in the window.This is the same as calling
lag(1)
// (empty, 1, 2, 2, 3) Seq.of(1, 2, 2, 3, 4).window().map(w -> w.lag());
-
lag
public java.util.Optional<T> lag(long lag)
Description copied from interface:Window
The previous value bylag
in the window.// (empty, 1, 2, 2, 3) Seq.of(1, 2, 2, 3, 4).window().map(w -> w.lag());
-
lead0
private java.util.Optional<T> lead0(long lead)
-
firstValue
public java.util.Optional<T> firstValue()
Description copied from interface:Window
The first value in the window.// (1, 1, 1, 1, 1) Seq.of(1, 2, 4, 2, 3).window().map(w -> w.firstValue());
- Specified by:
firstValue
in interfaceWindow<T>
-
firstValue
public <U> java.util.Optional<U> firstValue(java.util.function.Function<? super T,? extends U> function)
Description copied from interface:Window
The first value in the window.// (1, 1, 1, 1, 1) Seq.of(1, 2, 4, 2, 3).window().map(w -> w.firstValue());
- Specified by:
firstValue
in interfaceWindow<T>
-
lastValue
public java.util.Optional<T> lastValue()
Description copied from interface:Window
The last value in the window.// (3, 3, 3, 3, 3) Seq.of(1, 2, 4, 2, 3).window().map(w -> w.lastValue());
-
lastValue
public <U> java.util.Optional<U> lastValue(java.util.function.Function<? super T,? extends U> function)
Description copied from interface:Window
The last value in the window.// (3, 3, 3, 3, 3) Seq.of(1, 2, 4, 2, 3).window().map(w -> w.lastValue());
-
nthValue
public java.util.Optional<T> nthValue(long n)
Description copied from interface:Window
The nth value in the window.// (4, 4, 4, 4, 4) Seq.of(1, 2, 4, 2, 3).window().map(w -> w.nthValue(2));
-
nthValue
public <U> java.util.Optional<U> nthValue(long n, java.util.function.Function<? super T,? extends U> function)
Description copied from interface:Window
The nth value in the window.// (4, 4, 4, 4, 4) Seq.of(1, 2, 4, 2, 3).window().map(w -> w.nthValue(2));
-
count
public long count()
Description copied from interface:Collectable
Count the values in this collectable.- Specified by:
count
in interfaceCollectable<T>
-
count
public long count(java.util.function.Predicate<? super T> predicate)
Description copied from interface:Collectable
Count the values in this collectable, for which a predicate evaluates to true.- Specified by:
count
in interfaceCollectable<T>
-
countDistinct
public long countDistinct()
Description copied from interface:Collectable
Count the distinct values in this collectable.- Specified by:
countDistinct
in interfaceCollectable<T>
-
countDistinct
public long countDistinct(java.util.function.Predicate<? super T> predicate)
Description copied from interface:Collectable
Count the distinct values in this collectable, for which a predicate evaluates to true.- Specified by:
countDistinct
in interfaceCollectable<T>
-
countDistinctBy
public <U> long countDistinctBy(java.util.function.Function<? super T,? extends U> function)
Description copied from interface:Collectable
Count the distinct values of a given expression in this collectable.- Specified by:
countDistinctBy
in interfaceCollectable<T>
-
countDistinctBy
public <U> long countDistinctBy(java.util.function.Function<? super T,? extends U> function, java.util.function.Predicate<? super U> predicate)
Description copied from interface:Collectable
Count the distinct values of a given expression in this collectable, for which a predicate evaluates to true.- Specified by:
countDistinctBy
in interfaceCollectable<T>
-
sum
public java.util.Optional<T> sum()
Description copied from interface:Collectable
Get the sum of the elements in this collectable.- Specified by:
sum
in interfaceCollectable<T>
-
sum
public <U> java.util.Optional<U> sum(java.util.function.Function<? super T,? extends U> function)
Description copied from interface:Collectable
Get the sum of the elements in this collectable.- Specified by:
sum
in interfaceCollectable<T>
-
sumInt
public int sumInt(java.util.function.ToIntFunction<? super T> function)
Description copied from interface:Collectable
Get the sum of the elements in this collectable asint
.- Specified by:
sumInt
in interfaceCollectable<T>
-
sumLong
public long sumLong(java.util.function.ToLongFunction<? super T> function)
Description copied from interface:Collectable
Get the sum of the elements in this collectable aslong
.- Specified by:
sumLong
in interfaceCollectable<T>
-
sumDouble
public double sumDouble(java.util.function.ToDoubleFunction<? super T> function)
Description copied from interface:Collectable
Get the sum of the elements in this collectable asdouble
.- Specified by:
sumDouble
in interfaceCollectable<T>
-
avg
public java.util.Optional<T> avg()
Description copied from interface:Collectable
Get the average of the elements in this collectable.- Specified by:
avg
in interfaceCollectable<T>
-
avg
public <U> java.util.Optional<U> avg(java.util.function.Function<? super T,? extends U> function)
Description copied from interface:Collectable
Get the average of the elements in this collectable.- Specified by:
avg
in interfaceCollectable<T>
-
avgInt
public double avgInt(java.util.function.ToIntFunction<? super T> function)
Description copied from interface:Collectable
Get the average of the elements in this collectable asint
.- Specified by:
avgInt
in interfaceCollectable<T>
-
avgLong
public double avgLong(java.util.function.ToLongFunction<? super T> function)
Description copied from interface:Collectable
Get the average of the elements in this collectable aslong
.- Specified by:
avgLong
in interfaceCollectable<T>
-
avgDouble
public double avgDouble(java.util.function.ToDoubleFunction<? super T> function)
Description copied from interface:Collectable
Get the average of the elements in this collectable asdouble
.- Specified by:
avgDouble
in interfaceCollectable<T>
-
min
public java.util.Optional<T> min()
Description copied from interface:Collectable
Get the minimum value.This makes the unsafe assumption that
<T extends Comparable<? super T>>
- Specified by:
min
in interfaceCollectable<T>
-
min
public java.util.Optional<T> min(java.util.Comparator<? super T> comparator)
Description copied from interface:Collectable
Get the minimum value by a function.- Specified by:
min
in interfaceCollectable<T>
-
min
public <U extends java.lang.Comparable<? super U>> java.util.Optional<U> min(java.util.function.Function<? super T,? extends U> function)
Description copied from interface:Collectable
Get the minimum value by a function.- Specified by:
min
in interfaceCollectable<T>
-
min
public <U> java.util.Optional<U> min(java.util.function.Function<? super T,? extends U> function, java.util.Comparator<? super U> comparator)
Description copied from interface:Collectable
Get the minimum value by a function.- Specified by:
min
in interfaceCollectable<T>
-
minBy
public <U extends java.lang.Comparable<? super U>> java.util.Optional<T> minBy(java.util.function.Function<? super T,? extends U> function)
Description copied from interface:Collectable
Get the minimum value by a function.- Specified by:
minBy
in interfaceCollectable<T>
-
minBy
public <U> java.util.Optional<T> minBy(java.util.function.Function<? super T,? extends U> function, java.util.Comparator<? super U> comparator)
Description copied from interface:Collectable
Get the minimum value by a function.- Specified by:
minBy
in interfaceCollectable<T>
-
minAll
public Seq<T> minAll()
Description copied from interface:Collectable
Get the minimum values.This makes the unsafe assumption that
<T extends Comparable<? super T>>
- Specified by:
minAll
in interfaceCollectable<T>
-
minAll
public Seq<T> minAll(java.util.Comparator<? super T> comparator)
Description copied from interface:Collectable
Get the minimum values by a function.- Specified by:
minAll
in interfaceCollectable<T>
-
minAll
public <U extends java.lang.Comparable<? super U>> Seq<U> minAll(java.util.function.Function<? super T,? extends U> function)
Description copied from interface:Collectable
Get the minimum values by a function.- Specified by:
minAll
in interfaceCollectable<T>
-
minAll
public <U> Seq<U> minAll(java.util.function.Function<? super T,? extends U> function, java.util.Comparator<? super U> comparator)
Description copied from interface:Collectable
Get the minimum values by a function.- Specified by:
minAll
in interfaceCollectable<T>
-
minAllBy
public <U extends java.lang.Comparable<? super U>> Seq<T> minAllBy(java.util.function.Function<? super T,? extends U> function)
Description copied from interface:Collectable
Get the minimum values by a function.- Specified by:
minAllBy
in interfaceCollectable<T>
-
minAllBy
public <U> Seq<T> minAllBy(java.util.function.Function<? super T,? extends U> function, java.util.Comparator<? super U> comparator)
Description copied from interface:Collectable
Get the minimum values by a function.- Specified by:
minAllBy
in interfaceCollectable<T>
-
max
public java.util.Optional<T> max()
Description copied from interface:Collectable
Get the maximum value.This makes the unsafe assumption that
<T extends Comparable<? super T>>
- Specified by:
max
in interfaceCollectable<T>
-
max
public java.util.Optional<T> max(java.util.Comparator<? super T> comparator)
Description copied from interface:Collectable
Get the maximum value by a function.- Specified by:
max
in interfaceCollectable<T>
-
max
public <U extends java.lang.Comparable<? super U>> java.util.Optional<U> max(java.util.function.Function<? super T,? extends U> function)
Description copied from interface:Collectable
Get the maximum value by a function.- Specified by:
max
in interfaceCollectable<T>
-
max
public <U> java.util.Optional<U> max(java.util.function.Function<? super T,? extends U> function, java.util.Comparator<? super U> comparator)
Description copied from interface:Collectable
Get the maximum value by a function.- Specified by:
max
in interfaceCollectable<T>
-
maxBy
public <U extends java.lang.Comparable<? super U>> java.util.Optional<T> maxBy(java.util.function.Function<? super T,? extends U> function)
Description copied from interface:Collectable
Get the maximum value by a function.- Specified by:
maxBy
in interfaceCollectable<T>
-
maxBy
public <U> java.util.Optional<T> maxBy(java.util.function.Function<? super T,? extends U> function, java.util.Comparator<? super U> comparator)
Description copied from interface:Collectable
Get the maximum value by a function.- Specified by:
maxBy
in interfaceCollectable<T>
-
maxAll
public Seq<T> maxAll()
Description copied from interface:Collectable
Get the maximum values.This makes the unsafe assumption that
<T extends Comparable<? super T>>
- Specified by:
maxAll
in interfaceCollectable<T>
-
maxAll
public Seq<T> maxAll(java.util.Comparator<? super T> comparator)
Description copied from interface:Collectable
Get the maximum values by a function.- Specified by:
maxAll
in interfaceCollectable<T>
-
maxAll
public <U extends java.lang.Comparable<? super U>> Seq<U> maxAll(java.util.function.Function<? super T,? extends U> function)
Description copied from interface:Collectable
Get the maximum values by a function.- Specified by:
maxAll
in interfaceCollectable<T>
-
maxAll
public <U> Seq<U> maxAll(java.util.function.Function<? super T,? extends U> function, java.util.Comparator<? super U> comparator)
Description copied from interface:Collectable
Get the maximum values by a function.- Specified by:
maxAll
in interfaceCollectable<T>
-
maxAllBy
public <U extends java.lang.Comparable<? super U>> Seq<T> maxAllBy(java.util.function.Function<? super T,? extends U> function)
Description copied from interface:Collectable
Get the maximum values by a function.- Specified by:
maxAllBy
in interfaceCollectable<T>
-
maxAllBy
public <U> Seq<T> maxAllBy(java.util.function.Function<? super T,? extends U> function, java.util.Comparator<? super U> comparator)
Description copied from interface:Collectable
Get the maximum values by a function.- Specified by:
maxAllBy
in interfaceCollectable<T>
-
median
public java.util.Optional<T> median()
Description copied from interface:Collectable
Get the median value.This makes the unsafe assumption that
<T extends Comparable<? super T>>
- Specified by:
median
in interfaceCollectable<T>
-
median
public java.util.Optional<T> median(java.util.Comparator<? super T> comparator)
Description copied from interface:Collectable
Get the median value.- Specified by:
median
in interfaceCollectable<T>
-
medianBy
public <U extends java.lang.Comparable<? super U>> java.util.Optional<T> medianBy(java.util.function.Function<? super T,? extends U> function)
Description copied from interface:Collectable
Get the median value by a function.- Specified by:
medianBy
in interfaceCollectable<T>
-
medianBy
public <U> java.util.Optional<T> medianBy(java.util.function.Function<? super T,? extends U> function, java.util.Comparator<? super U> comparator)
Description copied from interface:Collectable
Get the median value by a function.- Specified by:
medianBy
in interfaceCollectable<T>
-
percentile
public java.util.Optional<T> percentile(double percentile)
Description copied from interface:Collectable
Get the discrete percentile value.This makes the unsafe assumption that
<T extends Comparable<? super T>>
- Specified by:
percentile
in interfaceCollectable<T>
-
percentile
public java.util.Optional<T> percentile(double percentile, java.util.Comparator<? super T> comparator)
Description copied from interface:Collectable
Get the discrete percentile value.- Specified by:
percentile
in interfaceCollectable<T>
-
percentileBy
public <U extends java.lang.Comparable<? super U>> java.util.Optional<T> percentileBy(double percentile, java.util.function.Function<? super T,? extends U> function)
Description copied from interface:Collectable
Get the discrete percentile value by a function.- Specified by:
percentileBy
in interfaceCollectable<T>
-
percentileBy
public <U> java.util.Optional<T> percentileBy(double percentile, java.util.function.Function<? super T,? extends U> function, java.util.Comparator<? super U> comparator)
Description copied from interface:Collectable
Get the discrete percentile value by a function.- Specified by:
percentileBy
in interfaceCollectable<T>
-
mode
public java.util.Optional<T> mode()
Description copied from interface:Collectable
Get the mode, i.e. the value that appears most often in the collectable.- Specified by:
mode
in interfaceCollectable<T>
-
modeBy
public <U> java.util.Optional<T> modeBy(java.util.function.Function<? super T,? extends U> function)
Description copied from interface:Collectable
Get the mode, i.e. the value that appears most often in the collectable.- Specified by:
modeBy
in interfaceCollectable<T>
-
modeAll
public Seq<T> modeAll()
Description copied from interface:Collectable
Get the mode, i.e. the values that appear most often in the collectable.- Specified by:
modeAll
in interfaceCollectable<T>
-
modeAllBy
public <U> Seq<T> modeAllBy(java.util.function.Function<? super T,? extends U> function)
Description copied from interface:Collectable
Get the mode, i.e. the values that appear most often in the collectable.- Specified by:
modeAllBy
in interfaceCollectable<T>
-
allMatch
public boolean allMatch(java.util.function.Predicate<? super T> predicate)
Description copied from interface:Collectable
Whether all elements in the collectable match a given predicate.- Specified by:
allMatch
in interfaceCollectable<T>
-
anyMatch
public boolean anyMatch(java.util.function.Predicate<? super T> predicate)
Description copied from interface:Collectable
Whether any element in the collectable matches a given predicate.- Specified by:
anyMatch
in interfaceCollectable<T>
-
noneMatch
public boolean noneMatch(java.util.function.Predicate<? super T> predicate)
Description copied from interface:Collectable
Whether no element in the collectable matches a given predicate.- Specified by:
noneMatch
in interfaceCollectable<T>
-
bitAnd
public java.util.Optional<T> bitAnd()
Description copied from interface:Collectable
Collect all bits in this stream into a single value by applying bitwise and.- Specified by:
bitAnd
in interfaceCollectable<T>
-
bitAnd
public <U> java.util.Optional<U> bitAnd(java.util.function.Function<? super T,? extends U> function)
Description copied from interface:Collectable
Collect all bits in this stream into a single value by applying bitwise and.- Specified by:
bitAnd
in interfaceCollectable<T>
-
bitAndInt
public int bitAndInt(java.util.function.ToIntFunction<? super T> function)
Description copied from interface:Collectable
Collect all bits in this stream into a single value by applying bitwise and.- Specified by:
bitAndInt
in interfaceCollectable<T>
-
bitAndLong
public long bitAndLong(java.util.function.ToLongFunction<? super T> function)
Description copied from interface:Collectable
Collect all bits in this stream into a single value by applying bitwise and.- Specified by:
bitAndLong
in interfaceCollectable<T>
-
bitOr
public java.util.Optional<T> bitOr()
Description copied from interface:Collectable
Collect all bits in this stream into a single value by applying bitwise or.- Specified by:
bitOr
in interfaceCollectable<T>
-
bitOr
public <U> java.util.Optional<U> bitOr(java.util.function.Function<? super T,? extends U> function)
Description copied from interface:Collectable
Collect all bits in this stream into a single value by applying bitwise or.- Specified by:
bitOr
in interfaceCollectable<T>
-
bitOrInt
public int bitOrInt(java.util.function.ToIntFunction<? super T> function)
Description copied from interface:Collectable
Collect all bits in this stream into a single value by applying bitwise or.- Specified by:
bitOrInt
in interfaceCollectable<T>
-
bitOrLong
public long bitOrLong(java.util.function.ToLongFunction<? super T> function)
Description copied from interface:Collectable
Collect all bits in this stream into a single value by applying bitwise or.- Specified by:
bitOrLong
in interfaceCollectable<T>
-
collect
public <R,A> R collect(java.util.stream.Collector<? super T,A,R> collector)
Description copied from interface:Collectable
Collect this collectable.- Specified by:
collect
in interfaceCollectable<T>
-
toList
public java.util.List<T> toList()
Description copied from interface:Collectable
Collect the collectable into anArrayList
.- Specified by:
toList
in interfaceCollectable<T>
-
toList
public <L extends java.util.List<T>> L toList(java.util.function.Supplier<L> factory)
Description copied from interface:Collectable
Collect the collectable into aList
.- Specified by:
toList
in interfaceCollectable<T>
-
toUnmodifiableList
public java.util.List<T> toUnmodifiableList()
Description copied from interface:Collectable
Collect the collectable into an unmodifiableList
.- Specified by:
toUnmodifiableList
in interfaceCollectable<T>
-
toSet
public java.util.Set<T> toSet()
Description copied from interface:Collectable
Collect the collectable into aLinkedHashSet
.- Specified by:
toSet
in interfaceCollectable<T>
-
toSet
public <S extends java.util.Set<T>> S toSet(java.util.function.Supplier<S> factory)
Description copied from interface:Collectable
Collect the collectable into aSet
.- Specified by:
toSet
in interfaceCollectable<T>
-
toUnmodifiableSet
public java.util.Set<T> toUnmodifiableSet()
Description copied from interface:Collectable
Collect the collectable into an unmodifiableSet
.- Specified by:
toUnmodifiableSet
in interfaceCollectable<T>
-
toCollection
public <C extends java.util.Collection<T>> C toCollection(java.util.function.Supplier<C> factory)
Description copied from interface:Collectable
Collect the collectable into aCollection
.- Specified by:
toCollection
in interfaceCollectable<T>
-
toMap
public <K,V> java.util.Map<K,V> toMap(java.util.function.Function<? super T,? extends K> keyMapper, java.util.function.Function<? super T,? extends V> valueMapper)
Description copied from interface:Collectable
Collect the collectable into aMap
.- Specified by:
toMap
in interfaceCollectable<T>
-
toMap
public <K> java.util.Map<K,T> toMap(java.util.function.Function<? super T,? extends K> keyMapper)
Description copied from interface:Collectable
Collect the collectable into aMap
with the given keys and the self element as value.- Specified by:
toMap
in interfaceCollectable<T>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
toString
public java.lang.String toString(java.lang.CharSequence delimiter)
Description copied from interface:Collectable
Consume a stream and concatenate all elements using a separator.- Specified by:
toString
in interfaceCollectable<T>
-
toString
public java.lang.String toString(java.lang.CharSequence delimiter, java.lang.CharSequence prefix, java.lang.CharSequence suffix)
Description copied from interface:Collectable
Shortcut for callingStream.collect(Collector)
with aCollectors.joining(CharSequence, CharSequence, CharSequence)
collector.- Specified by:
toString
in interfaceCollectable<T>
-
commonPrefix
public java.lang.String commonPrefix()
Description copied from interface:Collectable
Get the common prefix of all strings (or to-stringed values) in this stream.- Specified by:
commonPrefix
in interfaceCollectable<T>
-
commonSuffix
public java.lang.String commonSuffix()
Description copied from interface:Collectable
Get the common prefix of all strings (or to-stringed values) in this stream.- Specified by:
commonSuffix
in interfaceCollectable<T>
-
-