Class WindowImpl<T>
java.lang.Object
org.jooq.lambda.WindowImpl<T>
- All Implemented Interfaces:
Collectable<T>, Window<T>
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionWindowImpl(Tuple2<T, Long> value, Partition<T> partition, WindowSpecification<T> specification) -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether all elements in the collectable match a given predicate.booleanWhether any element in the collectable matches a given predicate.avg()Get the average of the elements in this collectable.<U> Optional<U> Get the average of the elements in this collectable.doubleavgDouble(ToDoubleFunction<? super T> function) Get the average of the elements in this collectable asdouble.doubleavgInt(ToIntFunction<? super T> function) Get the average of the elements in this collectable asint.doubleavgLong(ToLongFunction<? super T> function) Get the average of the elements in this collectable aslong.bitAnd()Collect all bits in this stream into a single value by applying bitwise and.<U> Optional<U> Collect all bits in this stream into a single value by applying bitwise and.intbitAndInt(ToIntFunction<? super T> function) Collect all bits in this stream into a single value by applying bitwise and.longbitAndLong(ToLongFunction<? super T> function) Collect all bits in this stream into a single value by applying bitwise and.bitOr()Collect all bits in this stream into a single value by applying bitwise or.<U> Optional<U> Collect all bits in this stream into a single value by applying bitwise or.intbitOrInt(ToIntFunction<? super T> function) Collect all bits in this stream into a single value by applying bitwise or.longbitOrLong(ToLongFunction<? super T> function) Collect all bits in this stream into a single value by applying bitwise or.<R,A> R Collect this collectable.Get the common prefix of all strings (or to-stringed values) in this stream.Get the common prefix of all strings (or to-stringed values) in this stream.private booleanlongcount()Count the values in this collectable.longCount the values in this collectable, for which a predicate evaluates to true.longCount the distinct values in this collectable.longcountDistinct(Predicate<? super T> predicate) Count the distinct values in this collectable, for which a predicate evaluates to true.<U> longcountDistinctBy(Function<? super T, ? extends U> function) Count the distinct values of a given expression in this collectable.<U> longcountDistinctBy(Function<? super T, ? extends U> function, Predicate<? super U> predicate) Count the distinct values of a given expression in this collectable, for which a predicate evaluates to true.longThe dense rank of the current row within the partition.The first value in the window.<U> Optional<U> firstValue(Function<? super T, ? extends U> function) The first value in the window.lag()The previous value in the window.lag(long lag) The previous value bylagin the window.The last value in the window.<U> Optional<U> The last value in the window.lead()The next value in the window.lead(long lead) The next value byleadin the window.lead0(long lead) private intlower()private booleanmax()Get the maximum value.max(Comparator<? super T> comparator) Get the maximum value by a function.<U extends Comparable<? super U>>
Optional<U> Get the maximum value by a function.<U> Optional<U> max(Function<? super T, ? extends U> function, Comparator<? super U> comparator) Get the maximum value by a function.maxAll()Get the maximum values.maxAll(Comparator<? super T> comparator) Get the maximum values by a function.<U extends Comparable<? super U>>
Seq<U> Get the maximum values by a function.<U> Seq<U> maxAll(Function<? super T, ? extends U> function, Comparator<? super U> comparator) Get the maximum values by a function.<U extends Comparable<? super U>>
Seq<T> Get the maximum values by a function.maxAllBy(Function<? super T, ? extends U> function, Comparator<? super U> comparator) Get the maximum values by a function.<U extends Comparable<? super U>>
Optional<T> Get the maximum value by a function.maxBy(Function<? super T, ? extends U> function, Comparator<? super U> comparator) Get the maximum value by a function.median()Get the median value.median(Comparator<? super T> comparator) Get the median value.<U extends Comparable<? super U>>
Optional<T> Get the median value by a function.medianBy(Function<? super T, ? extends U> function, Comparator<? super U> comparator) Get the median value by a function.min()Get the minimum value.min(Comparator<? super T> comparator) Get the minimum value by a function.<U extends Comparable<? super U>>
Optional<U> Get the minimum value by a function.<U> Optional<U> min(Function<? super T, ? extends U> function, Comparator<? super U> comparator) Get the minimum value by a function.minAll()Get the minimum values.minAll(Comparator<? super T> comparator) Get the minimum values by a function.<U extends Comparable<? super U>>
Seq<U> Get the minimum values by a function.<U> Seq<U> minAll(Function<? super T, ? extends U> function, Comparator<? super U> comparator) Get the minimum values by a function.<U extends Comparable<? super U>>
Seq<T> Get the minimum values by a function.minAllBy(Function<? super T, ? extends U> function, Comparator<? super U> comparator) Get the minimum values by a function.<U extends Comparable<? super U>>
Optional<T> Get the minimum value by a function.minBy(Function<? super T, ? extends U> function, Comparator<? super U> comparator) Get the minimum value by a function.mode()Get the mode, i.e.modeAll()Get the mode, i.e.Get the mode, i.e.Get the mode, i.e.booleanWhether no element in the collectable matches a given predicate.nthValue(long n) The nth value in the window.<U> Optional<U> The nth value in the window.longntile(long bucket) The bucket number ("ntile") of the current row within the partition.percentile(double percentile) Get the discrete percentile value.percentile(double percentile, Comparator<? super T> comparator) Get the discrete percentile value.<U extends Comparable<? super U>>
Optional<T> percentileBy(double percentile, Function<? super T, ? extends U> function) Get the discrete percentile value by a function.percentileBy(double percentile, Function<? super T, ? extends U> function, Comparator<? super U> comparator) Get the discrete percentile value by a function.doubleThe precent rank of the current row within the partition.longrank()The rank of the current row within the partition.longThe row number of the current row within the partition.sum()Get the sum of the elements in this collectable.<U> Optional<U> Get the sum of the elements in this collectable.doublesumDouble(ToDoubleFunction<? super T> function) Get the sum of the elements in this collectable asdouble.intsumInt(ToIntFunction<? super T> function) Get the sum of the elements in this collectable asint.longsumLong(ToLongFunction<? super T> function) Get the sum of the elements in this collectable aslong.<C extends Collection<T>>
CtoCollection(Supplier<C> factory) Collect the collectable into aCollection.toList()Collect the collectable into anArrayList.Collect the collectable into aList.Collect the collectable into aMapwith the given keys and the self element as value.<K,V> Map <K, V> Collect the collectable into aMap.toSet()Collect the collectable into aLinkedHashSet.Collect the collectable into aSet.toString()toString(CharSequence delimiter) Consume a stream and concatenate all elements using a separator.toString(CharSequence delimiter, CharSequence prefix, CharSequence suffix) Shortcut for callingStream.collect(Collector)with aCollectors.joining(CharSequence, CharSequence, CharSequence)collector.Collect the collectable into an unmodifiableList.Collect the collectable into an unmodifiableSet.private intupper()private booleanvalue()The value of the current row in the window.window()Stream all elements in the window.
-
Field Details
-
value
-
index
final int index -
partition
-
order
-
lower
final long lower -
upper
final long upper
-
-
Constructor Details
-
WindowImpl
-
-
Method Details
-
value
-
window
-
lower
private int lower() -
lowerInPartition
private boolean lowerInPartition() -
upper
private int upper() -
upperInPartition
private boolean upperInPartition() -
completePartition
private boolean completePartition() -
rowNumber
-
rank
-
denseRank
-
percentRank
public double percentRank()Description copied from interface:WindowThe 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:
percentRankin interfaceWindow<T>
-
ntile
-
lead
-
lead
-
lag
-
lag
-
lead0
-
firstValue
-
firstValue
-
lastValue
-
lastValue
-
nthValue
-
nthValue
-
count
public long count()Description copied from interface:CollectableCount the values in this collectable.- Specified by:
countin interfaceCollectable<T>
-
count
Description copied from interface:CollectableCount the values in this collectable, for which a predicate evaluates to true.- Specified by:
countin interfaceCollectable<T>
-
countDistinct
public long countDistinct()Description copied from interface:CollectableCount the distinct values in this collectable.- Specified by:
countDistinctin interfaceCollectable<T>
-
countDistinct
Description copied from interface:CollectableCount the distinct values in this collectable, for which a predicate evaluates to true.- Specified by:
countDistinctin interfaceCollectable<T>
-
countDistinctBy
Description copied from interface:CollectableCount the distinct values of a given expression in this collectable.- Specified by:
countDistinctByin interfaceCollectable<T>
-
countDistinctBy
public <U> long countDistinctBy(Function<? super T, ? extends U> function, Predicate<? super U> predicate) Description copied from interface:CollectableCount the distinct values of a given expression in this collectable, for which a predicate evaluates to true.- Specified by:
countDistinctByin interfaceCollectable<T>
-
sum
Description copied from interface:CollectableGet the sum of the elements in this collectable.- Specified by:
sumin interfaceCollectable<T>
-
sum
Description copied from interface:CollectableGet the sum of the elements in this collectable.- Specified by:
sumin interfaceCollectable<T>
-
sumInt
Description copied from interface:CollectableGet the sum of the elements in this collectable asint.- Specified by:
sumIntin interfaceCollectable<T>
-
sumLong
Description copied from interface:CollectableGet the sum of the elements in this collectable aslong.- Specified by:
sumLongin interfaceCollectable<T>
-
sumDouble
Description copied from interface:CollectableGet the sum of the elements in this collectable asdouble.- Specified by:
sumDoublein interfaceCollectable<T>
-
avg
Description copied from interface:CollectableGet the average of the elements in this collectable.- Specified by:
avgin interfaceCollectable<T>
-
avg
Description copied from interface:CollectableGet the average of the elements in this collectable.- Specified by:
avgin interfaceCollectable<T>
-
avgInt
Description copied from interface:CollectableGet the average of the elements in this collectable asint.- Specified by:
avgIntin interfaceCollectable<T>
-
avgLong
Description copied from interface:CollectableGet the average of the elements in this collectable aslong.- Specified by:
avgLongin interfaceCollectable<T>
-
avgDouble
Description copied from interface:CollectableGet the average of the elements in this collectable asdouble.- Specified by:
avgDoublein interfaceCollectable<T>
-
min
Description copied from interface:CollectableGet the minimum value.This makes the unsafe assumption that
<T extends Comparable<? super T>>- Specified by:
minin interfaceCollectable<T>
-
min
Description copied from interface:CollectableGet the minimum value by a function.- Specified by:
minin interfaceCollectable<T>
-
min
Description copied from interface:CollectableGet the minimum value by a function.- Specified by:
minin interfaceCollectable<T>
-
min
public <U> Optional<U> min(Function<? super T, ? extends U> function, Comparator<? super U> comparator) Description copied from interface:CollectableGet the minimum value by a function.- Specified by:
minin interfaceCollectable<T>
-
minBy
public <U extends Comparable<? super U>> Optional<T> minBy(Function<? super T, ? extends U> function) Description copied from interface:CollectableGet the minimum value by a function.- Specified by:
minByin interfaceCollectable<T>
-
minBy
public <U> Optional<T> minBy(Function<? super T, ? extends U> function, Comparator<? super U> comparator) Description copied from interface:CollectableGet the minimum value by a function.- Specified by:
minByin interfaceCollectable<T>
-
minAll
Description copied from interface:CollectableGet the minimum values.This makes the unsafe assumption that
<T extends Comparable<? super T>>- Specified by:
minAllin interfaceCollectable<T>
-
minAll
Description copied from interface:CollectableGet the minimum values by a function.- Specified by:
minAllin interfaceCollectable<T>
-
minAll
Description copied from interface:CollectableGet the minimum values by a function.- Specified by:
minAllin interfaceCollectable<T>
-
minAll
public <U> Seq<U> minAll(Function<? super T, ? extends U> function, Comparator<? super U> comparator) Description copied from interface:CollectableGet the minimum values by a function.- Specified by:
minAllin interfaceCollectable<T>
-
minAllBy
Description copied from interface:CollectableGet the minimum values by a function.- Specified by:
minAllByin interfaceCollectable<T>
-
minAllBy
public <U> Seq<T> minAllBy(Function<? super T, ? extends U> function, Comparator<? super U> comparator) Description copied from interface:CollectableGet the minimum values by a function.- Specified by:
minAllByin interfaceCollectable<T>
-
max
Description copied from interface:CollectableGet the maximum value.This makes the unsafe assumption that
<T extends Comparable<? super T>>- Specified by:
maxin interfaceCollectable<T>
-
max
Description copied from interface:CollectableGet the maximum value by a function.- Specified by:
maxin interfaceCollectable<T>
-
max
Description copied from interface:CollectableGet the maximum value by a function.- Specified by:
maxin interfaceCollectable<T>
-
max
public <U> Optional<U> max(Function<? super T, ? extends U> function, Comparator<? super U> comparator) Description copied from interface:CollectableGet the maximum value by a function.- Specified by:
maxin interfaceCollectable<T>
-
maxBy
public <U extends Comparable<? super U>> Optional<T> maxBy(Function<? super T, ? extends U> function) Description copied from interface:CollectableGet the maximum value by a function.- Specified by:
maxByin interfaceCollectable<T>
-
maxBy
public <U> Optional<T> maxBy(Function<? super T, ? extends U> function, Comparator<? super U> comparator) Description copied from interface:CollectableGet the maximum value by a function.- Specified by:
maxByin interfaceCollectable<T>
-
maxAll
Description copied from interface:CollectableGet the maximum values.This makes the unsafe assumption that
<T extends Comparable<? super T>>- Specified by:
maxAllin interfaceCollectable<T>
-
maxAll
Description copied from interface:CollectableGet the maximum values by a function.- Specified by:
maxAllin interfaceCollectable<T>
-
maxAll
Description copied from interface:CollectableGet the maximum values by a function.- Specified by:
maxAllin interfaceCollectable<T>
-
maxAll
public <U> Seq<U> maxAll(Function<? super T, ? extends U> function, Comparator<? super U> comparator) Description copied from interface:CollectableGet the maximum values by a function.- Specified by:
maxAllin interfaceCollectable<T>
-
maxAllBy
Description copied from interface:CollectableGet the maximum values by a function.- Specified by:
maxAllByin interfaceCollectable<T>
-
maxAllBy
public <U> Seq<T> maxAllBy(Function<? super T, ? extends U> function, Comparator<? super U> comparator) Description copied from interface:CollectableGet the maximum values by a function.- Specified by:
maxAllByin interfaceCollectable<T>
-
median
Description copied from interface:CollectableGet the median value.This makes the unsafe assumption that
<T extends Comparable<? super T>>- Specified by:
medianin interfaceCollectable<T>
-
median
Description copied from interface:CollectableGet the median value.- Specified by:
medianin interfaceCollectable<T>
-
medianBy
public <U extends Comparable<? super U>> Optional<T> medianBy(Function<? super T, ? extends U> function) Description copied from interface:CollectableGet the median value by a function.- Specified by:
medianByin interfaceCollectable<T>
-
medianBy
public <U> Optional<T> medianBy(Function<? super T, ? extends U> function, Comparator<? super U> comparator) Description copied from interface:CollectableGet the median value by a function.- Specified by:
medianByin interfaceCollectable<T>
-
percentile
Description copied from interface:CollectableGet the discrete percentile value.This makes the unsafe assumption that
<T extends Comparable<? super T>>- Specified by:
percentilein interfaceCollectable<T>
-
percentile
Description copied from interface:CollectableGet the discrete percentile value.- Specified by:
percentilein interfaceCollectable<T>
-
percentileBy
public <U extends Comparable<? super U>> Optional<T> percentileBy(double percentile, Function<? super T, ? extends U> function) Description copied from interface:CollectableGet the discrete percentile value by a function.- Specified by:
percentileByin interfaceCollectable<T>
-
percentileBy
public <U> Optional<T> percentileBy(double percentile, Function<? super T, ? extends U> function, Comparator<? super U> comparator) Description copied from interface:CollectableGet the discrete percentile value by a function.- Specified by:
percentileByin interfaceCollectable<T>
-
mode
Description copied from interface:CollectableGet the mode, i.e. the value that appears most often in the collectable.- Specified by:
modein interfaceCollectable<T>
-
modeBy
Description copied from interface:CollectableGet the mode, i.e. the value that appears most often in the collectable.- Specified by:
modeByin interfaceCollectable<T>
-
modeAll
Description copied from interface:CollectableGet the mode, i.e. the values that appear most often in the collectable.- Specified by:
modeAllin interfaceCollectable<T>
-
modeAllBy
Description copied from interface:CollectableGet the mode, i.e. the values that appear most often in the collectable.- Specified by:
modeAllByin interfaceCollectable<T>
-
allMatch
Description copied from interface:CollectableWhether all elements in the collectable match a given predicate.- Specified by:
allMatchin interfaceCollectable<T>
-
anyMatch
Description copied from interface:CollectableWhether any element in the collectable matches a given predicate.- Specified by:
anyMatchin interfaceCollectable<T>
-
noneMatch
Description copied from interface:CollectableWhether no element in the collectable matches a given predicate.- Specified by:
noneMatchin interfaceCollectable<T>
-
bitAnd
Description copied from interface:CollectableCollect all bits in this stream into a single value by applying bitwise and.- Specified by:
bitAndin interfaceCollectable<T>
-
bitAnd
Description copied from interface:CollectableCollect all bits in this stream into a single value by applying bitwise and.- Specified by:
bitAndin interfaceCollectable<T>
-
bitAndInt
Description copied from interface:CollectableCollect all bits in this stream into a single value by applying bitwise and.- Specified by:
bitAndIntin interfaceCollectable<T>
-
bitAndLong
Description copied from interface:CollectableCollect all bits in this stream into a single value by applying bitwise and.- Specified by:
bitAndLongin interfaceCollectable<T>
-
bitOr
Description copied from interface:CollectableCollect all bits in this stream into a single value by applying bitwise or.- Specified by:
bitOrin interfaceCollectable<T>
-
bitOr
Description copied from interface:CollectableCollect all bits in this stream into a single value by applying bitwise or.- Specified by:
bitOrin interfaceCollectable<T>
-
bitOrInt
Description copied from interface:CollectableCollect all bits in this stream into a single value by applying bitwise or.- Specified by:
bitOrIntin interfaceCollectable<T>
-
bitOrLong
Description copied from interface:CollectableCollect all bits in this stream into a single value by applying bitwise or.- Specified by:
bitOrLongin interfaceCollectable<T>
-
collect
Description copied from interface:CollectableCollect this collectable.- Specified by:
collectin interfaceCollectable<T>
-
toList
Description copied from interface:CollectableCollect the collectable into anArrayList.- Specified by:
toListin interfaceCollectable<T>
-
toList
Description copied from interface:CollectableCollect the collectable into aList.- Specified by:
toListin interfaceCollectable<T>
-
toUnmodifiableList
Description copied from interface:CollectableCollect the collectable into an unmodifiableList.- Specified by:
toUnmodifiableListin interfaceCollectable<T>
-
toSet
Description copied from interface:CollectableCollect the collectable into aLinkedHashSet.- Specified by:
toSetin interfaceCollectable<T>
-
toSet
Description copied from interface:CollectableCollect the collectable into aSet.- Specified by:
toSetin interfaceCollectable<T>
-
toUnmodifiableSet
Description copied from interface:CollectableCollect the collectable into an unmodifiableSet.- Specified by:
toUnmodifiableSetin interfaceCollectable<T>
-
toCollection
Description copied from interface:CollectableCollect the collectable into aCollection.- Specified by:
toCollectionin interfaceCollectable<T>
-
toMap
public <K,V> Map<K,V> toMap(Function<? super T, ? extends K> keyMapper, Function<? super T, ? extends V> valueMapper) Description copied from interface:CollectableCollect the collectable into aMap.- Specified by:
toMapin interfaceCollectable<T>
-
toMap
Description copied from interface:CollectableCollect the collectable into aMapwith the given keys and the self element as value.- Specified by:
toMapin interfaceCollectable<T>
-
toString
-
toString
Description copied from interface:CollectableConsume a stream and concatenate all elements using a separator.- Specified by:
toStringin interfaceCollectable<T>
-
toString
Description copied from interface:CollectableShortcut for callingStream.collect(Collector)with aCollectors.joining(CharSequence, CharSequence, CharSequence)collector.- Specified by:
toStringin interfaceCollectable<T>
-
commonPrefix
Description copied from interface:CollectableGet the common prefix of all strings (or to-stringed values) in this stream.- Specified by:
commonPrefixin interfaceCollectable<T>
-
commonSuffix
Description copied from interface:CollectableGet the common prefix of all strings (or to-stringed values) in this stream.- Specified by:
commonSuffixin interfaceCollectable<T>
-