Interface Collectable<T>

  • All Known Subinterfaces:
    Seq<T>, Window<T>


    public interface Collectable<T>
    A common super type for types like Seq or Window delegating common aggregation functions to collect(Collector)
    • Method Detail

      • collect

        <R,A> R collect(Collector<? super T,A,R> collector)
        Collect this collectable.
      • collect

        @Generated(value="This method was generated using jOOQ-tools")
        default <R1,R2,R3,R4,R5,R6,R7,R8,R9,R10,R11,R12,R13,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13> Tuple13<R1,R2,R3,R4,R5,R6,R7,R8,R9,R10,R11,R12,R13> collect(Collector<? super T,A1,R1> collector1,
                                                                                                                                                                                                                                   Collector<? super T,A2,R2> collector2,
                                                                                                                                                                                                                                   Collector<? super T,A3,R3> collector3,
                                                                                                                                                                                                                                   Collector<? super T,A4,R4> collector4,
                                                                                                                                                                                                                                   Collector<? super T,A5,R5> collector5,
                                                                                                                                                                                                                                   Collector<? super T,A6,R6> collector6,
                                                                                                                                                                                                                                   Collector<? super T,A7,R7> collector7,
                                                                                                                                                                                                                                   Collector<? super T,A8,R8> collector8,
                                                                                                                                                                                                                                   Collector<? super T,A9,R9> collector9,
                                                                                                                                                                                                                                   Collector<? super T,A10,R10> collector10,
                                                                                                                                                                                                                                   Collector<? super T,A11,R11> collector11,
                                                                                                                                                                                                                                   Collector<? super T,A12,R12> collector12,
                                                                                                                                                                                                                                   Collector<? super T,A13,R13> collector13)
        Collect this collectable into 13 Collectors.
      • collect

        @Generated(value="This method was generated using jOOQ-tools")
        default <R1,R2,R3,R4,R5,R6,R7,R8,R9,R10,R11,R12,R13,R14,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14> Tuple14<R1,R2,R3,R4,R5,R6,R7,R8,R9,R10,R11,R12,R13,R14> collect(Collector<? super T,A1,R1> collector1,
                                                                                                                                                                                                                                               Collector<? super T,A2,R2> collector2,
                                                                                                                                                                                                                                               Collector<? super T,A3,R3> collector3,
                                                                                                                                                                                                                                               Collector<? super T,A4,R4> collector4,
                                                                                                                                                                                                                                               Collector<? super T,A5,R5> collector5,
                                                                                                                                                                                                                                               Collector<? super T,A6,R6> collector6,
                                                                                                                                                                                                                                               Collector<? super T,A7,R7> collector7,
                                                                                                                                                                                                                                               Collector<? super T,A8,R8> collector8,
                                                                                                                                                                                                                                               Collector<? super T,A9,R9> collector9,
                                                                                                                                                                                                                                               Collector<? super T,A10,R10> collector10,
                                                                                                                                                                                                                                               Collector<? super T,A11,R11> collector11,
                                                                                                                                                                                                                                               Collector<? super T,A12,R12> collector12,
                                                                                                                                                                                                                                               Collector<? super T,A13,R13> collector13,
                                                                                                                                                                                                                                               Collector<? super T,A14,R14> collector14)
        Collect this collectable into 14 Collectors.
      • collect

        @Generated(value="This method was generated using jOOQ-tools")
        default <R1,R2,R3,R4,R5,R6,R7,R8,R9,R10,R11,R12,R13,R14,R15,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14,A15> Tuple15<R1,R2,R3,R4,R5,R6,R7,R8,R9,R10,R11,R12,R13,R14,R15> collect(Collector<? super T,A1,R1> collector1,
                                                                                                                                                                                                                                                           Collector<? super T,A2,R2> collector2,
                                                                                                                                                                                                                                                           Collector<? super T,A3,R3> collector3,
                                                                                                                                                                                                                                                           Collector<? super T,A4,R4> collector4,
                                                                                                                                                                                                                                                           Collector<? super T,A5,R5> collector5,
                                                                                                                                                                                                                                                           Collector<? super T,A6,R6> collector6,
                                                                                                                                                                                                                                                           Collector<? super T,A7,R7> collector7,
                                                                                                                                                                                                                                                           Collector<? super T,A8,R8> collector8,
                                                                                                                                                                                                                                                           Collector<? super T,A9,R9> collector9,
                                                                                                                                                                                                                                                           Collector<? super T,A10,R10> collector10,
                                                                                                                                                                                                                                                           Collector<? super T,A11,R11> collector11,
                                                                                                                                                                                                                                                           Collector<? super T,A12,R12> collector12,
                                                                                                                                                                                                                                                           Collector<? super T,A13,R13> collector13,
                                                                                                                                                                                                                                                           Collector<? super T,A14,R14> collector14,
                                                                                                                                                                                                                                                           Collector<? super T,A15,R15> collector15)
        Collect this collectable into 15 Collectors.
      • collect

        @Generated(value="This method was generated using jOOQ-tools")
        default <R1,R2,R3,R4,R5,R6,R7,R8,R9,R10,R11,R12,R13,R14,R15,R16,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14,A15,A16> Tuple16<R1,R2,R3,R4,R5,R6,R7,R8,R9,R10,R11,R12,R13,R14,R15,R16> collect(Collector<? super T,A1,R1> collector1,
                                                                                                                                                                                                                                                                       Collector<? super T,A2,R2> collector2,
                                                                                                                                                                                                                                                                       Collector<? super T,A3,R3> collector3,
                                                                                                                                                                                                                                                                       Collector<? super T,A4,R4> collector4,
                                                                                                                                                                                                                                                                       Collector<? super T,A5,R5> collector5,
                                                                                                                                                                                                                                                                       Collector<? super T,A6,R6> collector6,
                                                                                                                                                                                                                                                                       Collector<? super T,A7,R7> collector7,
                                                                                                                                                                                                                                                                       Collector<? super T,A8,R8> collector8,
                                                                                                                                                                                                                                                                       Collector<? super T,A9,R9> collector9,
                                                                                                                                                                                                                                                                       Collector<? super T,A10,R10> collector10,
                                                                                                                                                                                                                                                                       Collector<? super T,A11,R11> collector11,
                                                                                                                                                                                                                                                                       Collector<? super T,A12,R12> collector12,
                                                                                                                                                                                                                                                                       Collector<? super T,A13,R13> collector13,
                                                                                                                                                                                                                                                                       Collector<? super T,A14,R14> collector14,
                                                                                                                                                                                                                                                                       Collector<? super T,A15,R15> collector15,
                                                                                                                                                                                                                                                                       Collector<? super T,A16,R16> collector16)
        Collect this collectable into 16 Collectors.
      • count

        long count()
        Count the values in this collectable.
      • count

        long count(Predicate<? super T> predicate)
        Count the values in this collectable, for which a predicate evaluates to true.
      • countDistinct

        long countDistinct()
        Count the distinct values in this collectable.
      • countDistinct

        long countDistinct(Predicate<? super T> predicate)
        Count the distinct values in this collectable, for which a predicate evaluates to true.
      • countDistinctBy

        <U> long countDistinctBy(Function<? super T,? extends U> function)
        Count the distinct values of a given expression in this collectable.
      • countDistinctBy

        <U> long countDistinctBy(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.
      • mode

        Optional<T> mode()
        Get the mode, i.e. the value that appears most often in the collectable.
      • sum

        Optional<T> sum()
        Get the sum of the elements in this collectable.
      • sum

        <U> Optional<U> sum(Function<? super T,? extends U> function)
        Get the sum of the elements in this collectable.
      • sumInt

        int sumInt(ToIntFunction<? super T> function)
        Get the sum of the elements in this collectable as int.
      • sumLong

        long sumLong(ToLongFunction<? super T> function)
        Get the sum of the elements in this collectable as long.
      • sumDouble

        double sumDouble(ToDoubleFunction<? super T> function)
        Get the sum of the elements in this collectable as double.
      • avg

        Optional<T> avg()
        Get the average of the elements in this collectable.
      • avg

        <U> Optional<U> avg(Function<? super T,? extends U> function)
        Get the average of the elements in this collectable.
      • avgInt

        double avgInt(ToIntFunction<? super T> function)
        Get the average of the elements in this collectable as int.
      • avgLong

        double avgLong(ToLongFunction<? super T> function)
        Get the average of the elements in this collectable as long.
      • avgDouble

        double avgDouble(ToDoubleFunction<? super T> function)
        Get the average of the elements in this collectable as double.
      • min

        Optional<T> min()
        Get the minimum value.

        This makes the unsafe assumption that <T extends Comparable<? super T>>

      • min

        <U extends Comparable<? super U>> Optional<U> min(Function<? super T,? extends U> function)
        Get the minimum value by a function.
      • min

        <U> Optional<U> min(Function<? super T,? extends U> function,
                            Comparator<? super U> comparator)
        Get the minimum value by a function.
      • minBy

        <U extends Comparable<? super U>> Optional<T> minBy(Function<? super T,? extends U> function)
        Get the minimum value by a function.
      • minBy

        <U> Optional<T> minBy(Function<? super T,? extends U> function,
                              Comparator<? super U> comparator)
        Get the minimum value by a function.
      • max

        Optional<T> max()
        Get the maximum value.

        This makes the unsafe assumption that <T extends Comparable<? super T>>

      • max

        <U extends Comparable<? super U>> Optional<U> max(Function<? super T,? extends U> function)
        Get the maximum value by a function.
      • max

        <U> Optional<U> max(Function<? super T,? extends U> function,
                            Comparator<? super U> comparator)
        Get the maximum value by a function.
      • maxBy

        <U extends Comparable<? super U>> Optional<T> maxBy(Function<? super T,? extends U> function)
        Get the maximum value by a function.
      • maxBy

        <U> Optional<T> maxBy(Function<? super T,? extends U> function,
                              Comparator<? super U> comparator)
        Get the maximum value by a function.
      • median

        Optional<T> median()
        Get the median value.

        This makes the unsafe assumption that <T extends Comparable<? super T>>

      • medianBy

        <U extends Comparable<? super U>> Optional<T> medianBy(Function<? super T,? extends U> function)
        Get the median value by a function.
      • medianBy

        <U> Optional<T> medianBy(Function<? super T,? extends U> function,
                                 Comparator<? super U> comparator)
        Get the median value by a function.
      • percentile

        Optional<T> percentile(double percentile)
        Get the discrete percentile value.

        This makes the unsafe assumption that <T extends Comparable<? super T>>

      • percentile

        Optional<T> percentile(double percentile,
                               Comparator<? super T> comparator)
        Get the discrete percentile value.
      • percentileBy

        <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

        <U> Optional<T> percentileBy(double percentile,
                                     Function<? super T,? extends U> function,
                                     Comparator<? super U> comparator)
        Get the discrete percentile value by a function.
      • allMatch

        boolean allMatch(Predicate<? super T> predicate)
        Whether all elements in the collectable match a given predicate.
      • anyMatch

        boolean anyMatch(Predicate<? super T> predicate)
        Whether any element in the collectable matches a given predicate.
      • noneMatch

        boolean noneMatch(Predicate<? super T> predicate)
        Whether no element in the collectable matches a given predicate.
      • toList

        List<T> toList()
        Collect the collectable into an ArrayList.
      • toList

        <L extends List<T>> L toList(Supplier<L> factory)
        Collect the collectable into a List.
      • toSet

        <S extends Set<T>> S toSet(Supplier<S> factory)
        Collect the collectable into a Set.
      • toMap

        <K,V> Map<K,V> toMap(Function<? super T,? extends K> keyMapper,
                             Function<? super T,? extends V> valueMapper)
        Collect the collectable into a Map.
        See Also:
        #toMap(Stream, Function, Function)
      • toString

        String toString(CharSequence delimiter)
        Consume a stream and concatenate all elements using a separator.