Class EnumerableDefaults

java.lang.Object
org.apache.calcite.linq4j.EnumerableDefaults

public abstract class EnumerableDefaults extends Object
Default implementations of methods in the Enumerable interface.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <TSource> @Nullable TSource
    aggregate(Enumerable<TSource> source, Function2<@Nullable TSource,TSource,TSource> func)
    Applies an accumulator function over a sequence.
    static <TSource, TAccumulate>
    TAccumulate
    aggregate(Enumerable<TSource> source, TAccumulate seed, Function2<TAccumulate,TSource,TAccumulate> func)
    Applies an accumulator function over a sequence.
    static <TSource, TAccumulate, TResult>
    TResult
    aggregate(Enumerable<TSource> source, TAccumulate seed, Function2<TAccumulate,TSource,TAccumulate> func, Function1<TAccumulate,TResult> selector)
    Applies an accumulator function over a sequence.
    static <TSource> boolean
    all(Enumerable<TSource> enumerable, Predicate1<TSource> predicate)
    Determines whether all elements of a sequence satisfy a condition.
    static <TSource, TInner, TKey>
    Enumerable<TSource>
    antiJoin(Enumerable<TSource> outer, Enumerable<TInner> inner, Function1<TSource,TKey> outerKeySelector, Function1<TInner,TKey> innerKeySelector)
    Returns elements of outer for which there is NOT a member of inner with a matching key.
    static <TSource, TInner, TKey>
    Enumerable<TSource>
    antiJoin(Enumerable<TSource> outer, Enumerable<TInner> inner, Function1<TSource,TKey> outerKeySelector, Function1<TInner,TKey> innerKeySelector, EqualityComparer<TKey> comparer)
     
    static <TSource, TInner, TKey>
    Enumerable<TSource>
    antiJoin(Enumerable<TSource> outer, Enumerable<TInner> inner, Function1<TSource,TKey> outerKeySelector, Function1<TInner,TKey> innerKeySelector, EqualityComparer<TKey> comparer, Predicate2<TSource,TInner> nonEquiPredicate)
     
    static boolean
    any(Enumerable enumerable)
    Determines whether a sequence contains any elements.
    static <TSource> boolean
    any(Enumerable<TSource> enumerable, Predicate1<TSource> predicate)
    Determines whether any element of a sequence satisfies a condition.
    static <TSource> Enumerable<TSource>
    asEnumerable(Enumerable<TSource> enumerable)
    Returns the input typed as Enumerable<TSource>.
    static <T> OrderedQueryable<T>
     
    static <TSource> Queryable<TSource>
    asQueryable(Enumerable<TSource> enumerable)
    Converts an Enumerable to an IQueryable.
    static <TSource> BigDecimal
    average(Enumerable<TSource> source, BigDecimalFunction1<TSource> selector)
    Computes the average of a sequence of Decimal values that are obtained by invoking a transform function on each element of the input sequence.
    static <TSource> double
    average(Enumerable<TSource> source, DoubleFunction1<TSource> selector)
    Computes the average of a sequence of Double values that are obtained by invoking a transform function on each element of the input sequence.
    static <TSource> float
    average(Enumerable<TSource> source, FloatFunction1<TSource> selector)
    Computes the average of a sequence of Float values that are obtained by invoking a transform function on each element of the input sequence.
    static <TSource> int
    average(Enumerable<TSource> source, IntegerFunction1<TSource> selector)
    Computes the average of a sequence of int values that are obtained by invoking a transform function on each element of the input sequence.
    static <TSource> long
    average(Enumerable<TSource> source, LongFunction1<TSource> selector)
    Computes the average of a sequence of long values that are obtained by invoking a transform function on each element of the input sequence.
    static <TSource> BigDecimal
    average(Enumerable<TSource> source, NullableBigDecimalFunction1<TSource> selector)
    Computes the average of a sequence of nullable Decimal values that are obtained by invoking a transform function on each element of the input sequence.
    static <TSource> Double
    average(Enumerable<TSource> source, NullableDoubleFunction1<TSource> selector)
    Computes the average of a sequence of nullable Double values that are obtained by invoking a transform function on each element of the input sequence.
    static <TSource> Float
    average(Enumerable<TSource> source, NullableFloatFunction1<TSource> selector)
    Computes the average of a sequence of nullable Float values that are obtained by invoking a transform function on each element of the input sequence.
    static <TSource> Integer
    average(Enumerable<TSource> source, NullableIntegerFunction1<TSource> selector)
    Computes the average of a sequence of nullable int values that are obtained by invoking a transform function on each element of the input sequence.
    static <TSource> Long
    average(Enumerable<TSource> source, NullableLongFunction1<TSource> selector)
    Computes the average of a sequence of nullable long values that are obtained by invoking a transform function on each element of the input sequence.
    static <TSource, T2>
    Enumerable<T2>
    cast(Enumerable<TSource> source, Class<T2> clazz)
    Analogous to LINQ's Enumerable.Cast extension method.
    static int
    compareNullsLastForMergeJoin(@Nullable Comparable v0, @Nullable Comparable v1)
     
    static int
    compareNullsLastForMergeJoin(@Nullable Comparable v0, @Nullable Comparable v1, @Nullable Comparator comparator)
     
    static <TSource> Enumerable<TSource>
    concat(Enumerable<TSource> enumerable0, Enumerable<TSource> enumerable1)
    Concatenates two sequences.
    static <TSource> boolean
    contains(Enumerable<TSource> enumerable, TSource element)
    Determines whether a sequence contains a specified element by using the default equality comparer.
    static <TSource> boolean
    contains(Enumerable<TSource> enumerable, TSource element, EqualityComparer<TSource> comparer)
    Determines whether a sequence contains a specified element by using a specified EqualityComparer<TSource>.
    static <TSource, TInner, TResult>
    Enumerable<TResult>
    correlateBatchJoin(JoinType joinType, Enumerable<TSource> outer, Function1<List<TSource>,Enumerable<TInner>> inner, Function2<TSource,TInner,TResult> resultSelector, Predicate2<TSource,TInner> predicate, int batchSize)
    Fetches blocks of size batchSize from outer, storing each block into a list (outerValues).
    static <TSource, TInner, TResult>
    Enumerable<TResult>
    correlateJoin(JoinType joinType, Enumerable<TSource> outer, Function1<TSource,Enumerable<TInner>> inner, Function2<TSource,? super @Nullable TInner,TResult> resultSelector)
    For each row of the outer enumerable returns the correlated rows from the inner enumerable.
    static <TSource> int
    count(Enumerable<TSource> enumerable)
    Returns the number of elements in a sequence.
    static <TSource> int
    count(Enumerable<TSource> enumerable, Predicate1<TSource> predicate)
    Returns a number that represents how many elements in the specified sequence satisfy a condition.
    static <TSource, TKey>
    OrderedEnumerable<TSource>
    createOrderedEnumerable(OrderedEnumerable<TSource> source, Function1<TSource,TKey> keySelector, Comparator<TKey> comparator, boolean descending)
    Performs a subsequent ordering of the elements in a sequence according to a key.
    static <TSource> Enumerable<@Nullable TSource>
    defaultIfEmpty(Enumerable<TSource> enumerable)
    Returns the elements of the specified sequence or the type parameter's default value in a singleton collection if the sequence is empty.
    static <TSource> Enumerable<@PolyNull TSource>
    defaultIfEmpty(Enumerable<TSource> enumerable, @PolyNull TSource value)
    Returns the elements of the specified sequence or the specified value in a singleton collection if the sequence is empty.
    static <TSource> Enumerable<TSource>
    distinct(Enumerable<TSource> enumerable)
    Returns distinct elements from a sequence by using the default EqualityComparer to compare values.
    static <TSource> Enumerable<TSource>
    distinct(Enumerable<TSource> enumerable, EqualityComparer<TSource> comparer)
    Returns distinct elements from a sequence by using a specified EqualityComparer to compare values.
    static <TSource> TSource
    elementAt(Enumerable<TSource> enumerable, int index)
    Returns the element at a specified index in a sequence.
    static <TSource> @Nullable TSource
    elementAtOrDefault(Enumerable<TSource> enumerable, int index)
    Returns the element at a specified index in a sequence or a default value if the index is out of range.
    static <TSource> Enumerable<TSource>
    except(Enumerable<TSource> source0, Enumerable<TSource> source1)
    Produces the set difference of two sequences by using the default equality comparer to compare values, eliminate duplicates.
    static <TSource> Enumerable<TSource>
    except(Enumerable<TSource> source0, Enumerable<TSource> source1, boolean all)
    Produces the set difference of two sequences by using the default equality comparer to compare values, using all to indicate whether to eliminate duplicates.
    static <TSource> Enumerable<TSource>
    except(Enumerable<TSource> source0, Enumerable<TSource> source1, EqualityComparer<TSource> comparer)
    Produces the set difference of two sequences by using the specified EqualityComparer<TSource> to compare values, eliminate duplicates.
    static <TSource> Enumerable<TSource>
    except(Enumerable<TSource> source0, Enumerable<TSource> source1, EqualityComparer<TSource> comparer, boolean all)
    Produces the set difference of two sequences by using the specified EqualityComparer<TSource> to compare values, using all to indicate whether to eliminate duplicates.
    static <TSource> TSource
    first(Enumerable<TSource> enumerable)
    Returns the first element of a sequence.
    static <TSource> TSource
    first(Enumerable<TSource> enumerable, Predicate1<TSource> predicate)
    Returns the first element in a sequence that satisfies a specified condition.
    static <TSource> @Nullable TSource
    firstOrDefault(Enumerable<TSource> enumerable)
    Returns the first element of a sequence, or a default value if the sequence contains no elements.
    static <TSource> @Nullable TSource
    firstOrDefault(Enumerable<TSource> enumerable, Predicate1<TSource> predicate)
    Returns the first element of the sequence that satisfies a condition or a default value if no such element is found.
    static <TSource, TKey>
    Enumerable<Grouping<TKey,TSource>>
    groupBy(Enumerable<TSource> enumerable, Function1<TSource,TKey> keySelector)
    Groups the elements of a sequence according to a specified key selector function.
    static <TSource, TKey>
    Enumerable<Grouping<TKey,TSource>>
    groupBy(Enumerable<TSource> enumerable, Function1<TSource,TKey> keySelector, EqualityComparer<TKey> comparer)
    Groups the elements of a sequence according to a specified key selector function and compares the keys by using a specified comparer.
    static <TSource, TKey, TAccumulate, TResult>
    Enumerable<TResult>
    groupBy(Enumerable<TSource> enumerable, Function1<TSource,TKey> keySelector, Function0<TAccumulate> accumulatorInitializer, Function2<TAccumulate,TSource,TAccumulate> accumulatorAdder, Function2<TKey,TAccumulate,TResult> resultSelector)
    Groups the elements of a sequence according to a specified key selector function, initializing an accumulator for each group and adding to it each time an element with the same key is seen.
    static <TSource, TKey, TAccumulate, TResult>
    Enumerable<TResult>
    groupBy(Enumerable<TSource> enumerable, Function1<TSource,TKey> keySelector, Function0<TAccumulate> accumulatorInitializer, Function2<TAccumulate,TSource,TAccumulate> accumulatorAdder, Function2<TKey,TAccumulate,TResult> resultSelector, EqualityComparer<TKey> comparer)
    Groups the elements of a sequence according to a specified key selector function, initializing an accumulator for each group and adding to it each time an element with the same key is seen.
    static <TSource, TKey, TElement>
    Enumerable<Grouping<TKey,TElement>>
    groupBy(Enumerable<TSource> enumerable, Function1<TSource,TKey> keySelector, Function1<TSource,TElement> elementSelector)
    Groups the elements of a sequence according to a specified key selector function and projects the elements for each group by using a specified function.
    static <TSource, TKey, TElement>
    Enumerable<Grouping<TKey,TElement>>
    groupBy(Enumerable<TSource> enumerable, Function1<TSource,TKey> keySelector, Function1<TSource,TElement> elementSelector, EqualityComparer<TKey> comparer)
    Groups the elements of a sequence according to a key selector function.
    static <TSource, TKey, TElement, TResult>
    Enumerable<TResult>
    groupBy(Enumerable<TSource> enumerable, Function1<TSource,TKey> keySelector, Function1<TSource,TElement> elementSelector, Function2<TKey,Enumerable<TElement>,TResult> resultSelector)
    Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key.
    static <TSource, TKey, TElement, TResult>
    Enumerable<TResult>
    groupBy(Enumerable<TSource> enumerable, Function1<TSource,TKey> keySelector, Function1<TSource,TElement> elementSelector, Function2<TKey,Enumerable<TElement>,TResult> resultSelector, EqualityComparer<TKey> comparer)
    Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key.
    static <TSource, TKey, TResult>
    Enumerable<TResult>
    groupBy(Enumerable<TSource> enumerable, Function1<TSource,TKey> keySelector, Function2<TKey,Enumerable<TSource>,TResult> resultSelector)
    Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key.
    static <TSource, TKey, TResult>
    Enumerable<TResult>
    groupBy(Enumerable<TSource> enumerable, Function1<TSource,TKey> keySelector, Function2<TKey,Enumerable<TSource>,TResult> resultSelector, EqualityComparer<TKey> comparer)
    Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key.
    static <TSource, TKey, TAccumulate, TResult>
    Enumerable<TResult>
    groupByMultiple(Enumerable<TSource> enumerable, List<Function1<TSource,TKey>> keySelectors, Function0<TAccumulate> accumulatorInitializer, Function2<TAccumulate,TSource,TAccumulate> accumulatorAdder, Function2<TKey,TAccumulate,TResult> resultSelector)
    Groups the elements of a sequence according to a list of specified key selector functions, initializing an accumulator for each group and adding to it each time an element with the same key is seen.
    static <TSource, TInner, TKey, TResult>
    Enumerable<TResult>
    groupJoin(Enumerable<TSource> outer, Enumerable<TInner> inner, Function1<TSource,TKey> outerKeySelector, Function1<TInner,TKey> innerKeySelector, Function2<TSource,Enumerable<TInner>,TResult> resultSelector)
    Correlates the elements of two sequences based on equality of keys and groups the results.
    static <TSource, TInner, TKey, TResult>
    Enumerable<TResult>
    groupJoin(Enumerable<TSource> outer, Enumerable<TInner> inner, Function1<TSource,TKey> outerKeySelector, Function1<TInner,TKey> innerKeySelector, Function2<TSource,Enumerable<TInner>,TResult> resultSelector, EqualityComparer<TKey> comparer)
    Correlates the elements of two sequences based on key equality and groups the results.
    static <TSource, TInner, TKey, TResult>
    Enumerable<TResult>
    hashJoin(Enumerable<TSource> outer, Enumerable<TInner> inner, Function1<TSource,TKey> outerKeySelector, Function1<TInner,TKey> innerKeySelector, Function2<TSource,TInner,TResult> resultSelector)
    Correlates the elements of two sequences based on matching keys.
    static <TSource, TInner, TKey, TResult>
    Enumerable<TResult>
    hashJoin(Enumerable<TSource> outer, Enumerable<TInner> inner, Function1<TSource,TKey> outerKeySelector, Function1<TInner,TKey> innerKeySelector, Function2<TSource,TInner,TResult> resultSelector, @Nullable EqualityComparer<TKey> comparer, boolean generateNullsOnLeft, boolean generateNullsOnRight)
    Correlates the elements of two sequences based on matching keys.
    static <TSource, TInner, TKey, TResult>
    Enumerable<TResult>
    hashJoin(Enumerable<TSource> outer, Enumerable<TInner> inner, Function1<TSource,TKey> outerKeySelector, Function1<TInner,TKey> innerKeySelector, Function2<TSource,TInner,TResult> resultSelector, @Nullable EqualityComparer<TKey> comparer, boolean generateNullsOnLeft, boolean generateNullsOnRight, @Nullable Predicate2<TSource,TInner> predicate)
    Correlates the elements of two sequences based on matching keys.
    static <TSource, TInner, TKey, TResult>
    Enumerable<TResult>
    hashJoin(Enumerable<TSource> outer, Enumerable<TInner> inner, Function1<TSource,TKey> outerKeySelector, Function1<TInner,TKey> innerKeySelector, Function2<TSource,TInner,TResult> resultSelector, EqualityComparer<TKey> comparer)
    Correlates the elements of two sequences based on matching keys.
    static <TSource> Enumerable<TSource>
    intersect(Enumerable<TSource> source0, Enumerable<TSource> source1)
    Produces the set intersection of two sequences by using the default equality comparer to compare values, eliminate duplicates.(Defined by Enumerable.)
    static <TSource> Enumerable<TSource>
    intersect(Enumerable<TSource> source0, Enumerable<TSource> source1, boolean all)
    Produces the set intersection of two sequences by using the default equality comparer to compare values, using all to indicate whether to eliminate duplicates.
    static <TSource> Enumerable<TSource>
    intersect(Enumerable<TSource> source0, Enumerable<TSource> source1, EqualityComparer<TSource> comparer)
    Produces the set intersection of two sequences by using the specified EqualityComparer<TSource> to compare values, eliminate duplicates.
    static <TSource> Enumerable<TSource>
    intersect(Enumerable<TSource> source0, Enumerable<TSource> source1, EqualityComparer<TSource> comparer, boolean all)
    Produces the set intersection of two sequences by using the specified EqualityComparer<TSource> to compare values, using all to indicate whether to eliminate duplicates.
    static <T, C extends Collection<? super T>>
    C
    into(Enumerable<T> source, C sink)
    Default implementation of ExtendedEnumerable.into(Collection).
    static boolean
    Returns if certain join type is supported by Enumerable Merge Join implementation.
    static <TSource> TSource
    last(Enumerable<TSource> enumerable)
    Returns the last element of a sequence.
    static <TSource> TSource
    last(Enumerable<TSource> enumerable, Predicate1<TSource> predicate)
    Returns the last element of a sequence that satisfies a specified condition.
    static <TSource> @Nullable TSource
    lastOrDefault(Enumerable<TSource> enumerable)
    Returns the last element of a sequence, or a default value if the sequence contains no elements.
    static <TSource> @Nullable TSource
    lastOrDefault(Enumerable<TSource> enumerable, Predicate1<TSource> predicate)
    Returns the last element of a sequence that satisfies a condition or a default value if no such element is found.
    static <TSource> Enumerable<TSource>
    lazyCollectionSpool(Collection<TSource> outputCollection, Enumerable<TSource> input)
    Lazy read and lazy write spool that stores data into a collection.
    static <TSource> long
    longCount(Enumerable<TSource> source)
    Returns an long that represents the total number of elements in a sequence.
    static <TSource> long
    longCount(Enumerable<TSource> enumerable, Predicate1<TSource> predicate)
    Returns an long that represents how many elements in a sequence satisfy a condition.
    static <TSource extends Comparable<TSource>>
    TSource
    max(Enumerable<TSource> source)
    Returns the maximum value in a generic sequence.
    static <TSource> BigDecimal
    max(Enumerable<TSource> source, BigDecimalFunction1<TSource> selector)
    Invokes a transform function on each element of a sequence and returns the maximum Decimal value.
    static <TSource> double
    max(Enumerable<TSource> source, DoubleFunction1<TSource> selector)
    Invokes a transform function on each element of a sequence and returns the maximum Double value.
    static <TSource> float
    max(Enumerable<TSource> source, FloatFunction1<TSource> selector)
    Invokes a transform function on each element of a sequence and returns the maximum Float value.
    static <TSource, TResult extends Comparable<TResult>>
    @Nullable TResult
    max(Enumerable<TSource> source, Function1<TSource,TResult> selector)
    Invokes a transform function on each element of a generic sequence and returns the maximum resulting value.
    static <TSource> int
    max(Enumerable<TSource> source, IntegerFunction1<TSource> selector)
    Invokes a transform function on each element of a sequence and returns the maximum int value.
    static <TSource> long
    max(Enumerable<TSource> source, LongFunction1<TSource> selector)
    Invokes a transform function on each element of a sequence and returns the maximum long value.
    static <TSource> BigDecimal
    max(Enumerable<TSource> source, NullableBigDecimalFunction1<TSource> selector)
    Invokes a transform function on each element of a sequence and returns the maximum nullable Decimal value.
    static <TSource> Double
    max(Enumerable<TSource> source, NullableDoubleFunction1<TSource> selector)
    Invokes a transform function on each element of a sequence and returns the maximum nullable Double value.
    static <TSource> @Nullable Float
    max(Enumerable<TSource> source, NullableFloatFunction1<TSource> selector)
    Invokes a transform function on each element of a sequence and returns the maximum nullable Float value.
    static <TSource> Integer
    max(Enumerable<TSource> source, NullableIntegerFunction1<TSource> selector)
    Invokes a transform function on each element of a sequence and returns the maximum nullable int value.
    static <TSource> @Nullable Long
    max(Enumerable<TSource> source, NullableLongFunction1<TSource> selector)
    Invokes a transform function on each element of a sequence and returns the maximum nullable long value.
    static <TSource, TInner, TKey extends Comparable<TKey>, TResult>
    Enumerable<TResult>
    mergeJoin(Enumerable<TSource> outer, Enumerable<TInner> inner, Function1<TSource,TKey> outerKeySelector, Function1<TInner,TKey> innerKeySelector, @Nullable Predicate2<TSource,TInner> extraPredicate, Function2<TSource,@Nullable TInner,TResult> resultSelector, JoinType joinType, @Nullable Comparator<TKey> comparator, @Nullable EqualityComparer<TKey> equalityComparer)
    Joins two inputs that are sorted on the key, with an extra predicate for non equi-join conditions.
    static <TSource, TInner, TKey extends Comparable<TKey>, TResult>
    Enumerable<TResult>
    mergeJoin(Enumerable<TSource> outer, Enumerable<TInner> inner, Function1<TSource,TKey> outerKeySelector, Function1<TInner,TKey> innerKeySelector, Function2<TSource,@Nullable TInner,TResult> resultSelector, boolean generateNullsOnLeft, boolean generateNullsOnRight)
    static <TSource, TInner, TKey extends Comparable<TKey>, TResult>
    Enumerable<TResult>
    mergeJoin(Enumerable<TSource> outer, Enumerable<TInner> inner, Function1<TSource,TKey> outerKeySelector, Function1<TInner,TKey> innerKeySelector, Function2<TSource,@Nullable TInner,TResult> resultSelector, JoinType joinType, Comparator<TKey> comparator)
    Joins two inputs that are sorted on the key.
    static <TSource, TKey>
    Enumerable<TSource>
    mergeUnion(List<Enumerable<TSource>> sources, Function1<TSource,TKey> sortKeySelector, Comparator<TKey> sortComparator, boolean all, EqualityComparer<TSource> equalityComparer)
    Merge Union Enumerable.
    static <TSource extends Comparable<TSource>>
    @Nullable TSource
    min(Enumerable<TSource> source)
    Returns the minimum value in a generic sequence.
    static <TSource> BigDecimal
    min(Enumerable<TSource> source, BigDecimalFunction1<TSource> selector)
    Invokes a transform function on each element of a sequence and returns the minimum Decimal value.
    static <TSource> double
    min(Enumerable<TSource> source, DoubleFunction1<TSource> selector)
    Invokes a transform function on each element of a sequence and returns the minimum Double value.
    static <TSource> float
    min(Enumerable<TSource> source, FloatFunction1<TSource> selector)
    Invokes a transform function on each element of a sequence and returns the minimum Float value.
    static <TSource, TResult extends Comparable<TResult>>
    @Nullable TResult
    min(Enumerable<TSource> source, Function1<TSource,TResult> selector)
    Invokes a transform function on each element of a generic sequence and returns the minimum resulting value.
    static <TSource> int
    min(Enumerable<TSource> source, IntegerFunction1<TSource> selector)
    Invokes a transform function on each element of a sequence and returns the minimum int value.
    static <TSource> long
    min(Enumerable<TSource> source, LongFunction1<TSource> selector)
    Invokes a transform function on each element of a sequence and returns the minimum long value.
    static <TSource> BigDecimal
    min(Enumerable<TSource> source, NullableBigDecimalFunction1<TSource> selector)
    Invokes a transform function on each element of a sequence and returns the minimum nullable Decimal value.
    static <TSource> Double
    min(Enumerable<TSource> source, NullableDoubleFunction1<TSource> selector)
    Invokes a transform function on each element of a sequence and returns the minimum nullable Double value.
    static <TSource> Float
    min(Enumerable<TSource> source, NullableFloatFunction1<TSource> selector)
    Invokes a transform function on each element of a sequence and returns the minimum nullable Float value.
    static <TSource> Integer
    min(Enumerable<TSource> source, NullableIntegerFunction1<TSource> selector)
    Invokes a transform function on each element of a sequence and returns the minimum nullable int value.
    static <TSource> Long
    min(Enumerable<TSource> source, NullableLongFunction1<TSource> selector)
    Invokes a transform function on each element of a sequence and returns the minimum nullable long value.
    static <TSource, TInner, TResult>
    Enumerable<TResult>
    nestedLoopJoin(Enumerable<TSource> outer, Enumerable<TInner> inner, Predicate2<TSource,TInner> predicate, Function2<? super @Nullable TSource,? super @Nullable TInner,TResult> resultSelector, JoinType joinType)
    Correlates the elements of two sequences based on a predicate.
    static <TSource, TResult>
    Enumerable<TResult>
    ofType(Enumerable<TSource> enumerable, Class<TResult> clazz)
    Filters the elements of an Enumerable based on a specified type.
    static <TSource, TKey extends Comparable>
    Enumerable<TSource>
    orderBy(Enumerable<TSource> source, Function1<TSource,TKey> keySelector)
    Sorts the elements of a sequence in ascending order according to a key.
    static <TSource, TKey>
    Enumerable<TSource>
    orderBy(Enumerable<TSource> source, Function1<TSource,TKey> keySelector, @Nullable Comparator<TKey> comparator)
    Sorts the elements of a sequence in ascending order by using a specified comparer.
    static <TSource, TKey>
    Enumerable<TSource>
    orderBy(Enumerable<TSource> source, Function1<TSource,TKey> keySelector, Comparator<TKey> comparator, int offset, int fetch)
    A sort implementation optimized for a sort with a fetch size (LIMIT).
    static <TSource, TKey extends Comparable>
    Enumerable<TSource>
    orderByDescending(Enumerable<TSource> source, Function1<TSource,TKey> keySelector)
    Sorts the elements of a sequence in descending order according to a key.
    static <TSource, TKey>
    Enumerable<TSource>
    orderByDescending(Enumerable<TSource> source, Function1<TSource,TKey> keySelector, Comparator<TKey> comparator)
    Sorts the elements of a sequence in descending order by using a specified comparer.
    static <T, C extends Collection<? super T>>
    C
    remove(Enumerable<T> source, C sink)
    Default implementation of ExtendedEnumerable.removeAll(Collection).
    static <TSource> Enumerable<TSource>
    repeatUnion(Enumerable<TSource> seed, Enumerable<TSource> iteration, int iterationLimit, boolean all, EqualityComparer<TSource> comparer, @Nullable Function0<Boolean> cleanUpFunction)
    Repeat Union enumerable.
    static <TSource> Enumerable<TSource>
    reverse(Enumerable<TSource> source)
    Inverts the order of the elements in a sequence.
    static <TSource, TResult>
    Enumerable<TResult>
    select(Enumerable<TSource> source, Function1<TSource,TResult> selector)
    Projects each element of a sequence into a new form.
    static <TSource, TResult>
    Enumerable<TResult>
    select(Enumerable<TSource> source, Function2<TSource,Integer,TResult> selector)
    Projects each element of a sequence into a new form by incorporating the element's index.
    static <TSource, TCollection, TResult>
    Enumerable<TResult>
    selectMany(Enumerable<TSource> source, Function1<TSource,Enumerable<TCollection>> collectionSelector, Function2<TSource,TCollection,TResult> resultSelector)
    Projects each element of a sequence to an Enumerable<TSource>, flattens the resulting sequences into one sequence, and invokes a result selector function on each element therein.
    static <TSource, TResult>
    Enumerable<TResult>
    selectMany(Enumerable<TSource> source, Function1<TSource,Enumerable<TResult>> selector)
    Projects each element of a sequence to an Enumerable<TSource> and flattens the resulting sequences into one sequence.
    static <TSource, TCollection, TResult>
    Enumerable<TResult>
    selectMany(Enumerable<TSource> source, Function2<TSource,Integer,Enumerable<TCollection>> collectionSelector, Function2<TSource,TCollection,TResult> resultSelector)
    Projects each element of a sequence to an Enumerable<TSource>, flattens the resulting sequences into one sequence, and invokes a result selector function on each element therein.
    static <TSource, TResult>
    Enumerable<TResult>
    selectMany(Enumerable<TSource> source, Function2<TSource,Integer,Enumerable<TResult>> selector)
    Projects each element of a sequence to an Enumerable<TSource>, and flattens the resulting sequences into one sequence.
    static <TSource, TInner, TKey>
    Enumerable<TSource>
    semiJoin(Enumerable<TSource> outer, Enumerable<TInner> inner, Function1<TSource,TKey> outerKeySelector, Function1<TInner,TKey> innerKeySelector)
    Returns elements of outer for which there is a member of inner with a matching key.
    static <TSource, TInner, TKey>
    Enumerable<TSource>
    semiJoin(Enumerable<TSource> outer, Enumerable<TInner> inner, Function1<TSource,TKey> outerKeySelector, Function1<TInner,TKey> innerKeySelector, EqualityComparer<TKey> comparer)
     
    static <TSource, TInner, TKey>
    Enumerable<TSource>
    semiJoin(Enumerable<TSource> outer, Enumerable<TInner> inner, Function1<TSource,TKey> outerKeySelector, Function1<TInner,TKey> innerKeySelector, EqualityComparer<TKey> comparer, boolean anti, Predicate2<TSource,TInner> nonEquiPredicate)
    Returns elements of outer for which there is (semi-join) / is not (anti-semi-join) a member of inner with a matching key.
    static <TSource, TInner, TKey>
    Enumerable<TSource>
    semiJoin(Enumerable<TSource> outer, Enumerable<TInner> inner, Function1<TSource,TKey> outerKeySelector, Function1<TInner,TKey> innerKeySelector, EqualityComparer<TKey> comparer, Predicate2<TSource,TInner> nonEquiPredicate)
     
    static <TSource> boolean
    sequenceEqual(Enumerable<TSource> first, Enumerable<TSource> second)
    Determines whether two sequences are equal by comparing the elements by using the default equality comparer for their type.
    static <TSource> boolean
    sequenceEqual(Enumerable<TSource> first, Enumerable<TSource> second, @Nullable EqualityComparer<TSource> comparer)
    Determines whether two sequences are equal by comparing their elements by using a specified EqualityComparer<TSource>.
    static <TSource> TSource
    single(Enumerable<TSource> source)
    Returns the only element of a sequence, and throws an exception if there is not exactly one element in the sequence.
    static <TSource> TSource
    single(Enumerable<TSource> source, Predicate1<TSource> predicate)
    Returns the only element of a sequence that satisfies a specified condition, and throws an exception if more than one such element exists.
    static <TSource> @Nullable TSource
    singleOrDefault(Enumerable<TSource> source)
    Returns the only element of a sequence, or a default value if the sequence is empty; this method throws an exception if there is more than one element in the sequence.
    static <TSource> @Nullable TSource
    singleOrDefault(Enumerable<TSource> source, Predicate1<TSource> predicate)
    Returns the only element of a sequence that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition.
    static <TSource> Enumerable<TSource>
    skip(Enumerable<TSource> source, int count)
    Bypasses a specified number of elements in a sequence and then returns the remaining elements.
    static <TSource> Enumerable<TSource>
    skipWhile(Enumerable<TSource> source, Predicate1<TSource> predicate)
    Bypasses elements in a sequence as long as a specified condition is true and then returns the remaining elements.
    static <TSource> Enumerable<TSource>
    skipWhile(Enumerable<TSource> source, Predicate2<TSource,Integer> predicate)
    Bypasses elements in a sequence as long as a specified condition is true and then returns the remaining elements.
    static <TSource, TKey, TAccumulate, TResult>
    Enumerable<TResult>
    sortedGroupBy(Enumerable<TSource> enumerable, Function1<TSource,TKey> keySelector, Function0<TAccumulate> accumulatorInitializer, Function2<TAccumulate,TSource,TAccumulate> accumulatorAdder, Function2<TKey,TAccumulate,TResult> resultSelector, Comparator<TKey> comparator)
    Group keys are sorted already.
    static <TSource> BigDecimal
    sum(Enumerable<TSource> source, BigDecimalFunction1<TSource> selector)
    Computes the sum of the sequence of Decimal values that are obtained by invoking a transform function on each element of the input sequence.
    static <TSource> double
    sum(Enumerable<TSource> source, DoubleFunction1<TSource> selector)
    Computes the sum of the sequence of Double values that are obtained by invoking a transform function on each element of the input sequence.
    static <TSource> float
    sum(Enumerable<TSource> source, FloatFunction1<TSource> selector)
    Computes the sum of the sequence of Float values that are obtained by invoking a transform function on each element of the input sequence.
    static <TSource> int
    sum(Enumerable<TSource> source, IntegerFunction1<TSource> selector)
    Computes the sum of the sequence of int values that are obtained by invoking a transform function on each element of the input sequence.
    static <TSource> long
    sum(Enumerable<TSource> source, LongFunction1<TSource> selector)
    Computes the sum of the sequence of long values that are obtained by invoking a transform function on each element of the input sequence.
    static <TSource> BigDecimal
    sum(Enumerable<TSource> source, NullableBigDecimalFunction1<TSource> selector)
    Computes the sum of the sequence of nullable Decimal values that are obtained by invoking a transform function on each element of the input sequence.
    static <TSource> Double
    sum(Enumerable<TSource> source, NullableDoubleFunction1<TSource> selector)
    Computes the sum of the sequence of nullable Double values that are obtained by invoking a transform function on each element of the input sequence.
    static <TSource> Float
    sum(Enumerable<TSource> source, NullableFloatFunction1<TSource> selector)
    Computes the sum of the sequence of nullable Float values that are obtained by invoking a transform function on each element of the input sequence.
    static <TSource> Integer
    sum(Enumerable<TSource> source, NullableIntegerFunction1<TSource> selector)
    Computes the sum of the sequence of nullable int values that are obtained by invoking a transform function on each element of the input sequence.
    static <TSource> Long
    sum(Enumerable<TSource> source, NullableLongFunction1<TSource> selector)
    Computes the sum of the sequence of nullable long values that are obtained by invoking a transform function on each element of the input sequence.
    static <TSource> Enumerable<TSource>
    take(Enumerable<TSource> source, int count)
    Returns a specified number of contiguous elements from the start of a sequence.
    static <TSource> Enumerable<TSource>
    take(Enumerable<TSource> source, long count)
    Returns a specified number of contiguous elements from the start of a sequence.
    static <TSource> Enumerable<TSource>
    takeWhile(Enumerable<TSource> source, Predicate1<TSource> predicate)
    Returns elements from a sequence as long as a specified condition is true.
    static <TSource> Enumerable<TSource>
    takeWhile(Enumerable<TSource> source, Predicate2<TSource,Integer> predicate)
    Returns elements from a sequence as long as a specified condition is true.
    static <TSource> Enumerable<TSource>
    takeWhileLong(Enumerable<TSource> source, Predicate2<TSource,Long> predicate)
    Returns elements from a sequence as long as a specified condition is true.
    static <TSource, TKey extends Comparable<TKey>>
    OrderedEnumerable<TSource>
    thenBy(OrderedEnumerable<TSource> source, Function1<TSource,TKey> keySelector)
    Performs a subsequent ordering of the elements in a sequence in ascending order according to a key.
    static <TSource, TKey>
    OrderedEnumerable<TSource>
    thenBy(OrderedEnumerable<TSource> source, Function1<TSource,TKey> keySelector, Comparator<TKey> comparator)
    Performs a subsequent ordering of the elements in a sequence in ascending order according to a key, using a specified comparator.
    static <TSource, TKey extends Comparable<TKey>>
    OrderedEnumerable<TSource>
    thenByDescending(OrderedEnumerable<TSource> source, Function1<TSource,TKey> keySelector)
    Performs a subsequent ordering of the elements in a sequence in descending order according to a key.
    static <TSource, TKey>
    OrderedEnumerable<TSource>
    thenByDescending(OrderedEnumerable<TSource> source, Function1<TSource,TKey> keySelector, Comparator<TKey> comparator)
    Performs a subsequent ordering of the elements in a sequence in descending order according to a key, using a specified comparator.
    static <TSource> List<TSource>
    toList(Enumerable<TSource> source)
    Creates a List<TSource> from an Enumerable<TSource>.
    static <TSource, TKey>
    Lookup<TKey,TSource>
    toLookup(Enumerable<TSource> source, Function1<TSource,TKey> keySelector)
    Creates a Lookup<TKey, TElement> from an Enumerable<TSource> according to a specified key selector function.
    static <TSource, TKey>
    Lookup<TKey,TSource>
    toLookup(Enumerable<TSource> source, Function1<TSource,TKey> keySelector, EqualityComparer<TKey> comparer)
    Creates a Lookup<TKey, TElement> from an Enumerable<TSource> according to a specified key selector function and key comparer.
    static <TSource, TKey, TElement>
    Lookup<TKey,TElement>
    toLookup(Enumerable<TSource> source, Function1<TSource,TKey> keySelector, Function1<TSource,TElement> elementSelector)
    Creates a Lookup<TKey, TElement> from an Enumerable<TSource> according to specified key selector and element selector functions.
    static <TSource, TKey, TElement>
    Lookup<TKey,TElement>
    toLookup(Enumerable<TSource> source, Function1<TSource,TKey> keySelector, Function1<TSource,TElement> elementSelector, EqualityComparer<TKey> comparer)
    Creates a Lookup<TKey, TElement> from an Enumerable<TSource> according to a specified key selector function, a comparer and an element selector function.
    static <TSource, TKey>
    Map<TKey,TSource>
    toMap(Enumerable<TSource> source, Function1<TSource,TKey> keySelector)
    Creates a Map<TKey, TValue> from an Enumerable<TSource> according to a specified key selector function.
    static <TSource, TKey>
    Map<TKey,TSource>
    toMap(Enumerable<TSource> source, Function1<TSource,TKey> keySelector, EqualityComparer<TKey> comparer)
    Creates a Map<TKey, TValue> from an Enumerable<TSource> according to a specified key selector function and key comparer.
    static <TSource, TKey, TElement>
    Map<TKey,TElement>
    toMap(Enumerable<TSource> source, Function1<TSource,TKey> keySelector, Function1<TSource,TElement> elementSelector)
    Creates a Map<TKey, TValue> from an Enumerable<TSource> according to specified key selector and element selector functions.
    static <TSource, TKey, TElement>
    Map<TKey,TElement>
    toMap(Enumerable<TSource> source, Function1<TSource,TKey> keySelector, Function1<TSource,TElement> elementSelector, EqualityComparer<TKey> comparer)
    Creates a Map<TKey, TValue> from an Enumerable<TSource> according to a specified key selector function, a comparer, and an element selector function.
    static <TSource> Enumerable<TSource>
    union(Enumerable<TSource> source0, Enumerable<TSource> source1)
    Produces the set union of two sequences by using the default equality comparer.
    static <TSource> Enumerable<TSource>
    union(Enumerable<TSource> source0, Enumerable<TSource> source1, EqualityComparer<TSource> comparer)
    Produces the set union of two sequences by using a specified EqualityComparer<TSource>.
    static <TSource> Enumerable<TSource>
    where(Enumerable<TSource> source, Predicate1<TSource> predicate)
    Filters a sequence of values based on a predicate.
    static <TSource> Enumerable<TSource>
    where(Enumerable<TSource> source, Predicate2<TSource,Integer> predicate)
    Filters a sequence of values based on a predicate.
    static <T0, T1, TResult>
    Enumerable<TResult>
    zip(Enumerable<T0> first, Enumerable<T1> second, Function2<T0,T1,TResult> resultSelector)
    Applies a specified function to the corresponding elements of two sequences, producing a sequence of the results.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • EnumerableDefaults

      public EnumerableDefaults()
  • Method Details

    • aggregate

      public static <TSource> @Nullable TSource aggregate(Enumerable<TSource> source, Function2<@Nullable TSource,TSource,TSource> func)
      Applies an accumulator function over a sequence.
    • aggregate

      public static <TSource, TAccumulate> TAccumulate aggregate(Enumerable<TSource> source, TAccumulate seed, Function2<TAccumulate,TSource,TAccumulate> func)
      Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value.
    • aggregate

      public static <TSource, TAccumulate, TResult> TResult aggregate(Enumerable<TSource> source, TAccumulate seed, Function2<TAccumulate,TSource,TAccumulate> func, Function1<TAccumulate,TResult> selector)
      Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value, and the specified function is used to select the result value.
    • all

      public static <TSource> boolean all(Enumerable<TSource> enumerable, Predicate1<TSource> predicate)
      Determines whether all elements of a sequence satisfy a condition.
    • any

      public static boolean any(Enumerable enumerable)
      Determines whether a sequence contains any elements.
    • any

      public static <TSource> boolean any(Enumerable<TSource> enumerable, Predicate1<TSource> predicate)
      Determines whether any element of a sequence satisfies a condition.
    • asEnumerable

      public static <TSource> Enumerable<TSource> asEnumerable(Enumerable<TSource> enumerable)
      Returns the input typed as Enumerable<TSource>.

      This method has no effect other than to change the compile-time type of source from a type that implements Enumerable<TSource> to Enumerable<TSource> itself.

      AsEnumerable<TSource>(Enumerable<TSource>) can be used to choose between query implementations when a sequence implements Enumerable<TSource> but also has a different set of public query methods available. For example, given a generic class Table that implements Enumerable<TSource> and has its own methods such as where, select, and selectMany, a call to where would invoke the public where method of Table. A Table type that represents a database table could have a where method that takes the predicate argument as an expression tree and converts the tree to SQL for remote execution. If remote execution is not desired, for example because the predicate invokes a local method, the asEnumerable<TSource> method can be used to hide the custom methods and instead make the standard query operators available.

    • asQueryable

      public static <TSource> Queryable<TSource> asQueryable(Enumerable<TSource> enumerable)
      Converts an Enumerable to an IQueryable.

      Analogous to the LINQ's Enumerable.AsQueryable extension method.

      Type Parameters:
      TSource - Element type
      Parameters:
      enumerable - Enumerable
      Returns:
      A queryable
    • average

      public static <TSource> BigDecimal average(Enumerable<TSource> source, BigDecimalFunction1<TSource> selector)
      Computes the average of a sequence of Decimal values that are obtained by invoking a transform function on each element of the input sequence.
    • average

      public static <TSource> BigDecimal average(Enumerable<TSource> source, NullableBigDecimalFunction1<TSource> selector)
      Computes the average of a sequence of nullable Decimal values that are obtained by invoking a transform function on each element of the input sequence.
    • average

      public static <TSource> double average(Enumerable<TSource> source, DoubleFunction1<TSource> selector)
      Computes the average of a sequence of Double values that are obtained by invoking a transform function on each element of the input sequence.
    • average

      public static <TSource> Double average(Enumerable<TSource> source, NullableDoubleFunction1<TSource> selector)
      Computes the average of a sequence of nullable Double values that are obtained by invoking a transform function on each element of the input sequence.
    • average

      public static <TSource> int average(Enumerable<TSource> source, IntegerFunction1<TSource> selector)
      Computes the average of a sequence of int values that are obtained by invoking a transform function on each element of the input sequence.
    • average

      public static <TSource> Integer average(Enumerable<TSource> source, NullableIntegerFunction1<TSource> selector)
      Computes the average of a sequence of nullable int values that are obtained by invoking a transform function on each element of the input sequence.
    • average

      public static <TSource> long average(Enumerable<TSource> source, LongFunction1<TSource> selector)
      Computes the average of a sequence of long values that are obtained by invoking a transform function on each element of the input sequence.
    • average

      public static <TSource> Long average(Enumerable<TSource> source, NullableLongFunction1<TSource> selector)
      Computes the average of a sequence of nullable long values that are obtained by invoking a transform function on each element of the input sequence.
    • average

      public static <TSource> float average(Enumerable<TSource> source, FloatFunction1<TSource> selector)
      Computes the average of a sequence of Float values that are obtained by invoking a transform function on each element of the input sequence.
    • average

      public static <TSource> Float average(Enumerable<TSource> source, NullableFloatFunction1<TSource> selector)
      Computes the average of a sequence of nullable Float values that are obtained by invoking a transform function on each element of the input sequence.
    • cast

      public static <TSource, T2> Enumerable<T2> cast(Enumerable<TSource> source, Class<T2> clazz)
      Analogous to LINQ's Enumerable.Cast extension method.
      Type Parameters:
      T2 - Target type
      Parameters:
      clazz - Target type
      Returns:
      Collection of T2
    • concat

      public static <TSource> Enumerable<TSource> concat(Enumerable<TSource> enumerable0, Enumerable<TSource> enumerable1)
      Concatenates two sequences.
    • contains

      public static <TSource> boolean contains(Enumerable<TSource> enumerable, TSource element)
      Determines whether a sequence contains a specified element by using the default equality comparer.
    • contains

      public static <TSource> boolean contains(Enumerable<TSource> enumerable, TSource element, EqualityComparer<TSource> comparer)
      Determines whether a sequence contains a specified element by using a specified EqualityComparer<TSource>.
    • count

      public static <TSource> int count(Enumerable<TSource> enumerable)
      Returns the number of elements in a sequence.
    • count

      public static <TSource> int count(Enumerable<TSource> enumerable, Predicate1<TSource> predicate)
      Returns a number that represents how many elements in the specified sequence satisfy a condition.
    • defaultIfEmpty

      public static <TSource> Enumerable<@Nullable TSource> defaultIfEmpty(Enumerable<TSource> enumerable)
      Returns the elements of the specified sequence or the type parameter's default value in a singleton collection if the sequence is empty.
    • defaultIfEmpty

      public static <TSource> Enumerable<@PolyNull TSource> defaultIfEmpty(Enumerable<TSource> enumerable, @PolyNull TSource value)
      Returns the elements of the specified sequence or the specified value in a singleton collection if the sequence is empty.

      If value is not null, the result is never null.

    • distinct

      public static <TSource> Enumerable<TSource> distinct(Enumerable<TSource> enumerable)
      Returns distinct elements from a sequence by using the default EqualityComparer to compare values.
    • distinct

      public static <TSource> Enumerable<TSource> distinct(Enumerable<TSource> enumerable, EqualityComparer<TSource> comparer)
      Returns distinct elements from a sequence by using a specified EqualityComparer to compare values.
    • elementAt

      public static <TSource> TSource elementAt(Enumerable<TSource> enumerable, int index)
      Returns the element at a specified index in a sequence.
    • elementAtOrDefault

      public static <TSource> @Nullable TSource elementAtOrDefault(Enumerable<TSource> enumerable, int index)
      Returns the element at a specified index in a sequence or a default value if the index is out of range.
    • except

      public static <TSource> Enumerable<TSource> except(Enumerable<TSource> source0, Enumerable<TSource> source1)
      Produces the set difference of two sequences by using the default equality comparer to compare values, eliminate duplicates. (Defined by Enumerable.)
    • except

      public static <TSource> Enumerable<TSource> except(Enumerable<TSource> source0, Enumerable<TSource> source1, boolean all)
      Produces the set difference of two sequences by using the default equality comparer to compare values, using all to indicate whether to eliminate duplicates. (Defined by Enumerable.)
    • except

      public static <TSource> Enumerable<TSource> except(Enumerable<TSource> source0, Enumerable<TSource> source1, EqualityComparer<TSource> comparer)
      Produces the set difference of two sequences by using the specified EqualityComparer<TSource> to compare values, eliminate duplicates.
    • except

      public static <TSource> Enumerable<TSource> except(Enumerable<TSource> source0, Enumerable<TSource> source1, EqualityComparer<TSource> comparer, boolean all)
      Produces the set difference of two sequences by using the specified EqualityComparer<TSource> to compare values, using all to indicate whether to eliminate duplicates.
    • first

      public static <TSource> TSource first(Enumerable<TSource> enumerable)
      Returns the first element of a sequence. (Defined by Enumerable.)
    • first

      public static <TSource> TSource first(Enumerable<TSource> enumerable, Predicate1<TSource> predicate)
      Returns the first element in a sequence that satisfies a specified condition.
    • firstOrDefault

      public static <TSource> @Nullable TSource firstOrDefault(Enumerable<TSource> enumerable)
      Returns the first element of a sequence, or a default value if the sequence contains no elements.
    • firstOrDefault

      public static <TSource> @Nullable TSource firstOrDefault(Enumerable<TSource> enumerable, Predicate1<TSource> predicate)
      Returns the first element of the sequence that satisfies a condition or a default value if no such element is found.
    • groupBy

      public static <TSource, TKey> Enumerable<Grouping<TKey,TSource>> groupBy(Enumerable<TSource> enumerable, Function1<TSource,TKey> keySelector)
      Groups the elements of a sequence according to a specified key selector function.
    • groupBy

      public static <TSource, TKey> Enumerable<Grouping<TKey,TSource>> groupBy(Enumerable<TSource> enumerable, Function1<TSource,TKey> keySelector, EqualityComparer<TKey> comparer)
      Groups the elements of a sequence according to a specified key selector function and compares the keys by using a specified comparer.
    • groupBy

      public static <TSource, TKey, TElement> Enumerable<Grouping<TKey,TElement>> groupBy(Enumerable<TSource> enumerable, Function1<TSource,TKey> keySelector, Function1<TSource,TElement> elementSelector)
      Groups the elements of a sequence according to a specified key selector function and projects the elements for each group by using a specified function.
    • groupBy

      public static <TSource, TKey, TElement> Enumerable<Grouping<TKey,TElement>> groupBy(Enumerable<TSource> enumerable, Function1<TSource,TKey> keySelector, Function1<TSource,TElement> elementSelector, EqualityComparer<TKey> comparer)
      Groups the elements of a sequence according to a key selector function. The keys are compared by using a comparer and each group's elements are projected by using a specified function.
    • groupBy

      public static <TSource, TKey, TResult> Enumerable<TResult> groupBy(Enumerable<TSource> enumerable, Function1<TSource,TKey> keySelector, Function2<TKey,Enumerable<TSource>,TResult> resultSelector)
      Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key.
    • groupBy

      public static <TSource, TKey, TResult> Enumerable<TResult> groupBy(Enumerable<TSource> enumerable, Function1<TSource,TKey> keySelector, Function2<TKey,Enumerable<TSource>,TResult> resultSelector, EqualityComparer<TKey> comparer)
      Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. The keys are compared by using a specified comparer.
    • groupBy

      public static <TSource, TKey, TElement, TResult> Enumerable<TResult> groupBy(Enumerable<TSource> enumerable, Function1<TSource,TKey> keySelector, Function1<TSource,TElement> elementSelector, Function2<TKey,Enumerable<TElement>,TResult> resultSelector)
      Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. The elements of each group are projected by using a specified function.
    • groupBy

      public static <TSource, TKey, TElement, TResult> Enumerable<TResult> groupBy(Enumerable<TSource> enumerable, Function1<TSource,TKey> keySelector, Function1<TSource,TElement> elementSelector, Function2<TKey,Enumerable<TElement>,TResult> resultSelector, EqualityComparer<TKey> comparer)
      Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. Key values are compared by using a specified comparer, and the elements of each group are projected by using a specified function.
    • groupBy

      public static <TSource, TKey, TAccumulate, TResult> Enumerable<TResult> groupBy(Enumerable<TSource> enumerable, Function1<TSource,TKey> keySelector, Function0<TAccumulate> accumulatorInitializer, Function2<TAccumulate,TSource,TAccumulate> accumulatorAdder, Function2<TKey,TAccumulate,TResult> resultSelector)
      Groups the elements of a sequence according to a specified key selector function, initializing an accumulator for each group and adding to it each time an element with the same key is seen. Creates a result value from each accumulator and its key using a specified function.
    • groupByMultiple

      public static <TSource, TKey, TAccumulate, TResult> Enumerable<TResult> groupByMultiple(Enumerable<TSource> enumerable, List<Function1<TSource,TKey>> keySelectors, Function0<TAccumulate> accumulatorInitializer, Function2<TAccumulate,TSource,TAccumulate> accumulatorAdder, Function2<TKey,TAccumulate,TResult> resultSelector)
      Groups the elements of a sequence according to a list of specified key selector functions, initializing an accumulator for each group and adding to it each time an element with the same key is seen. Creates a result value from each accumulator and its key using a specified function.

      This method exists to support SQL GROUPING SETS. It does not correspond to any method in Enumerable.

    • groupBy

      public static <TSource, TKey, TAccumulate, TResult> Enumerable<TResult> groupBy(Enumerable<TSource> enumerable, Function1<TSource,TKey> keySelector, Function0<TAccumulate> accumulatorInitializer, Function2<TAccumulate,TSource,TAccumulate> accumulatorAdder, Function2<TKey,TAccumulate,TResult> resultSelector, EqualityComparer<TKey> comparer)
      Groups the elements of a sequence according to a specified key selector function, initializing an accumulator for each group and adding to it each time an element with the same key is seen. Creates a result value from each accumulator and its key using a specified function. Key values are compared by using a specified comparer.
    • sortedGroupBy

      public static <TSource, TKey, TAccumulate, TResult> Enumerable<TResult> sortedGroupBy(Enumerable<TSource> enumerable, Function1<TSource,TKey> keySelector, Function0<TAccumulate> accumulatorInitializer, Function2<TAccumulate,TSource,TAccumulate> accumulatorAdder, Function2<TKey,TAccumulate,TResult> resultSelector, Comparator<TKey> comparator)
      Group keys are sorted already. Key values are compared by using a specified comparator. Groups the elements of a sequence according to a specified key selector function and initializing one accumulator at a time. Go over elements sequentially, adding to accumulator each time an element with the same key is seen. When key changes, creates a result value from the accumulator and then re-initializes the accumulator. In the case of NULL values in group keys, the comparator must be able to support NULL values by giving a consistent sort ordering.
    • groupJoin

      public static <TSource, TInner, TKey, TResult> Enumerable<TResult> groupJoin(Enumerable<TSource> outer, Enumerable<TInner> inner, Function1<TSource,TKey> outerKeySelector, Function1<TInner,TKey> innerKeySelector, Function2<TSource,Enumerable<TInner>,TResult> resultSelector)
      Correlates the elements of two sequences based on equality of keys and groups the results. The default equality comparer is used to compare keys.
    • groupJoin

      public static <TSource, TInner, TKey, TResult> Enumerable<TResult> groupJoin(Enumerable<TSource> outer, Enumerable<TInner> inner, Function1<TSource,TKey> outerKeySelector, Function1<TInner,TKey> innerKeySelector, Function2<TSource,Enumerable<TInner>,TResult> resultSelector, EqualityComparer<TKey> comparer)
      Correlates the elements of two sequences based on key equality and groups the results. A specified EqualityComparer<TSource> is used to compare keys.
    • intersect

      public static <TSource> Enumerable<TSource> intersect(Enumerable<TSource> source0, Enumerable<TSource> source1)
      Produces the set intersection of two sequences by using the default equality comparer to compare values, eliminate duplicates.(Defined by Enumerable.)
    • intersect

      public static <TSource> Enumerable<TSource> intersect(Enumerable<TSource> source0, Enumerable<TSource> source1, boolean all)
      Produces the set intersection of two sequences by using the default equality comparer to compare values, using all to indicate whether to eliminate duplicates. (Defined by Enumerable.)
    • intersect

      public static <TSource> Enumerable<TSource> intersect(Enumerable<TSource> source0, Enumerable<TSource> source1, EqualityComparer<TSource> comparer)
      Produces the set intersection of two sequences by using the specified EqualityComparer<TSource> to compare values, eliminate duplicates.
    • intersect

      public static <TSource> Enumerable<TSource> intersect(Enumerable<TSource> source0, Enumerable<TSource> source1, EqualityComparer<TSource> comparer, boolean all)
      Produces the set intersection of two sequences by using the specified EqualityComparer<TSource> to compare values, using all to indicate whether to eliminate duplicates.
    • hashJoin

      public static <TSource, TInner, TKey, TResult> Enumerable<TResult> hashJoin(Enumerable<TSource> outer, Enumerable<TInner> inner, Function1<TSource,TKey> outerKeySelector, Function1<TInner,TKey> innerKeySelector, Function2<TSource,TInner,TResult> resultSelector)
      Correlates the elements of two sequences based on matching keys. The default equality comparer is used to compare keys.
    • hashJoin

      public static <TSource, TInner, TKey, TResult> Enumerable<TResult> hashJoin(Enumerable<TSource> outer, Enumerable<TInner> inner, Function1<TSource,TKey> outerKeySelector, Function1<TInner,TKey> innerKeySelector, Function2<TSource,TInner,TResult> resultSelector, EqualityComparer<TKey> comparer)
      Correlates the elements of two sequences based on matching keys. A specified EqualityComparer<TSource> is used to compare keys.
    • hashJoin

      public static <TSource, TInner, TKey, TResult> Enumerable<TResult> hashJoin(Enumerable<TSource> outer, Enumerable<TInner> inner, Function1<TSource,TKey> outerKeySelector, Function1<TInner,TKey> innerKeySelector, Function2<TSource,TInner,TResult> resultSelector, @Nullable EqualityComparer<TKey> comparer, boolean generateNullsOnLeft, boolean generateNullsOnRight)
      Correlates the elements of two sequences based on matching keys. A specified EqualityComparer<TSource> is used to compare keys.
    • hashJoin

      public static <TSource, TInner, TKey, TResult> Enumerable<TResult> hashJoin(Enumerable<TSource> outer, Enumerable<TInner> inner, Function1<TSource,TKey> outerKeySelector, Function1<TInner,TKey> innerKeySelector, Function2<TSource,TInner,TResult> resultSelector, @Nullable EqualityComparer<TKey> comparer, boolean generateNullsOnLeft, boolean generateNullsOnRight, @Nullable Predicate2<TSource,TInner> predicate)
      Correlates the elements of two sequences based on matching keys. A specified EqualityComparer<TSource> is used to compare keys.A predicate is used to filter the join result per-row.
    • correlateJoin

      public static <TSource, TInner, TResult> Enumerable<TResult> correlateJoin(JoinType joinType, Enumerable<TSource> outer, Function1<TSource,Enumerable<TInner>> inner, Function2<TSource,? super @Nullable TInner,TResult> resultSelector)
      For each row of the outer enumerable returns the correlated rows from the inner enumerable.
    • last

      public static <TSource> TSource last(Enumerable<TSource> enumerable)
      Returns the last element of a sequence. (Defined by Enumerable.)
    • correlateBatchJoin

      public static <TSource, TInner, TResult> Enumerable<TResult> correlateBatchJoin(JoinType joinType, Enumerable<TSource> outer, Function1<List<TSource>,Enumerable<TInner>> inner, Function2<TSource,TInner,TResult> resultSelector, Predicate2<TSource,TInner> predicate, int batchSize)
      Fetches blocks of size batchSize from outer, storing each block into a list (outerValues). For each block, it uses the inner function to obtain an enumerable with the correlated rows from the right (inner) input.

      Each result present in the innerEnumerator has matched at least one value from the block outerValues. At this point a mini nested loop is performed between the outer values and inner values using the predicate to find out the actual matching join results.

      In order to optimize this mini nested loop, during the first iteration (the first value from outerValues) we use the innerEnumerator to compare it to inner rows, and at the same time we fill a list (innerValues) with said innerEnumerator rows. In the subsequent iterations (2nd, 3rd, etc. value from outerValues) the list innerValues is used, since it contains all the innerEnumerator values, which were stored in the first iteration.

    • semiJoin

      public static <TSource, TInner, TKey> Enumerable<TSource> semiJoin(Enumerable<TSource> outer, Enumerable<TInner> inner, Function1<TSource,TKey> outerKeySelector, Function1<TInner,TKey> innerKeySelector)
      Returns elements of outer for which there is a member of inner with a matching key.
    • semiJoin

      public static <TSource, TInner, TKey> Enumerable<TSource> semiJoin(Enumerable<TSource> outer, Enumerable<TInner> inner, Function1<TSource,TKey> outerKeySelector, Function1<TInner,TKey> innerKeySelector, EqualityComparer<TKey> comparer)
    • semiJoin

      public static <TSource, TInner, TKey> Enumerable<TSource> semiJoin(Enumerable<TSource> outer, Enumerable<TInner> inner, Function1<TSource,TKey> outerKeySelector, Function1<TInner,TKey> innerKeySelector, EqualityComparer<TKey> comparer, Predicate2<TSource,TInner> nonEquiPredicate)
    • antiJoin

      public static <TSource, TInner, TKey> Enumerable<TSource> antiJoin(Enumerable<TSource> outer, Enumerable<TInner> inner, Function1<TSource,TKey> outerKeySelector, Function1<TInner,TKey> innerKeySelector)
      Returns elements of outer for which there is NOT a member of inner with a matching key.
    • antiJoin

      public static <TSource, TInner, TKey> Enumerable<TSource> antiJoin(Enumerable<TSource> outer, Enumerable<TInner> inner, Function1<TSource,TKey> outerKeySelector, Function1<TInner,TKey> innerKeySelector, EqualityComparer<TKey> comparer)
    • antiJoin

      public static <TSource, TInner, TKey> Enumerable<TSource> antiJoin(Enumerable<TSource> outer, Enumerable<TInner> inner, Function1<TSource,TKey> outerKeySelector, Function1<TInner,TKey> innerKeySelector, EqualityComparer<TKey> comparer, Predicate2<TSource,TInner> nonEquiPredicate)
    • semiJoin

      public static <TSource, TInner, TKey> Enumerable<TSource> semiJoin(Enumerable<TSource> outer, Enumerable<TInner> inner, Function1<TSource,TKey> outerKeySelector, Function1<TInner,TKey> innerKeySelector, EqualityComparer<TKey> comparer, boolean anti, Predicate2<TSource,TInner> nonEquiPredicate)
      Returns elements of outer for which there is (semi-join) / is not (anti-semi-join) a member of inner with a matching key. A specified EqualityComparer<TSource> is used to compare keys. A predicate is used to filter the join result per-row.
    • nestedLoopJoin

      public static <TSource, TInner, TResult> Enumerable<TResult> nestedLoopJoin(Enumerable<TSource> outer, Enumerable<TInner> inner, Predicate2<TSource,TInner> predicate, Function2<? super @Nullable TSource,? super @Nullable TInner,TResult> resultSelector, JoinType joinType)
      Correlates the elements of two sequences based on a predicate.
    • mergeJoin

      @Deprecated public static <TSource, TInner, TKey extends Comparable<TKey>, TResult> Enumerable<TResult> mergeJoin(Enumerable<TSource> outer, Enumerable<TInner> inner, Function1<TSource,TKey> outerKeySelector, Function1<TInner,TKey> innerKeySelector, Function2<TSource,@Nullable TInner,TResult> resultSelector, boolean generateNullsOnLeft, boolean generateNullsOnRight)
      Joins two inputs that are sorted on the key. Inputs must be sorted in ascending order, nulls last.
    • isMergeJoinSupported

      public static boolean isMergeJoinSupported(JoinType joinType)
      Returns if certain join type is supported by Enumerable Merge Join implementation.

      NOTE: This method is subject to change or be removed without notice.

    • mergeJoin

      public static <TSource, TInner, TKey extends Comparable<TKey>, TResult> Enumerable<TResult> mergeJoin(Enumerable<TSource> outer, Enumerable<TInner> inner, Function1<TSource,TKey> outerKeySelector, Function1<TInner,TKey> innerKeySelector, Function2<TSource,@Nullable TInner,TResult> resultSelector, JoinType joinType, Comparator<TKey> comparator)
      Joins two inputs that are sorted on the key. Inputs must be sorted in ascending order, nulls last.
    • mergeJoin

      @API(since="1.23", status=EXPERIMENTAL) public static <TSource, TInner, TKey extends Comparable<TKey>, TResult> Enumerable<TResult> mergeJoin(Enumerable<TSource> outer, Enumerable<TInner> inner, Function1<TSource,TKey> outerKeySelector, Function1<TInner,TKey> innerKeySelector, @Nullable Predicate2<TSource,TInner> extraPredicate, Function2<TSource,@Nullable TInner,TResult> resultSelector, JoinType joinType, @Nullable Comparator<TKey> comparator, @Nullable EqualityComparer<TKey> equalityComparer)
      Joins two inputs that are sorted on the key, with an extra predicate for non equi-join conditions.

      Inputs be must sorted in ascending order, nulls last.

      Parameters:
      extraPredicate - predicate for non equi-join conditions. In case of equi-join, it will be null. In case of non-equi join, the non-equi conditions will be evaluated using this extra predicate within the join process, and not applying a filter on top of the join results, because the latter strategy can only work on inner joins, and we aim to support other join types in the future (e.g. semi or anti joins).
      comparator - key comparator, possibly null (in which case Comparable.compareTo(T) will be used).
      equalityComparer - key equality comparer, possibly null (in which case equals will be used), required to compare keys from the same input.

      NOTE: The current API is experimental and subject to change without notice.

    • last

      public static <TSource> TSource last(Enumerable<TSource> enumerable, Predicate1<TSource> predicate)
      Returns the last element of a sequence that satisfies a specified condition.
    • lastOrDefault

      public static <TSource> @Nullable TSource lastOrDefault(Enumerable<TSource> enumerable)
      Returns the last element of a sequence, or a default value if the sequence contains no elements.
    • lastOrDefault

      public static <TSource> @Nullable TSource lastOrDefault(Enumerable<TSource> enumerable, Predicate1<TSource> predicate)
      Returns the last element of a sequence that satisfies a condition or a default value if no such element is found.
    • longCount

      public static <TSource> long longCount(Enumerable<TSource> source)
      Returns an long that represents the total number of elements in a sequence.
    • longCount

      public static <TSource> long longCount(Enumerable<TSource> enumerable, Predicate1<TSource> predicate)
      Returns an long that represents how many elements in a sequence satisfy a condition.
    • max

      public static <TSource extends Comparable<TSource>> TSource max(Enumerable<TSource> source)
      Returns the maximum value in a generic sequence.
    • max

      public static <TSource> BigDecimal max(Enumerable<TSource> source, BigDecimalFunction1<TSource> selector)
      Invokes a transform function on each element of a sequence and returns the maximum Decimal value.
    • max

      public static <TSource> BigDecimal max(Enumerable<TSource> source, NullableBigDecimalFunction1<TSource> selector)
      Invokes a transform function on each element of a sequence and returns the maximum nullable Decimal value.
    • max

      public static <TSource> double max(Enumerable<TSource> source, DoubleFunction1<TSource> selector)
      Invokes a transform function on each element of a sequence and returns the maximum Double value.
    • max

      public static <TSource> Double max(Enumerable<TSource> source, NullableDoubleFunction1<TSource> selector)
      Invokes a transform function on each element of a sequence and returns the maximum nullable Double value.
    • max

      public static <TSource> int max(Enumerable<TSource> source, IntegerFunction1<TSource> selector)
      Invokes a transform function on each element of a sequence and returns the maximum int value.
    • max

      public static <TSource> Integer max(Enumerable<TSource> source, NullableIntegerFunction1<TSource> selector)
      Invokes a transform function on each element of a sequence and returns the maximum nullable int value. (Defined by Enumerable.)
    • max

      public static <TSource> long max(Enumerable<TSource> source, LongFunction1<TSource> selector)
      Invokes a transform function on each element of a sequence and returns the maximum long value.
    • max

      public static <TSource> @Nullable Long max(Enumerable<TSource> source, NullableLongFunction1<TSource> selector)
      Invokes a transform function on each element of a sequence and returns the maximum nullable long value. (Defined by Enumerable.)
    • max

      public static <TSource> float max(Enumerable<TSource> source, FloatFunction1<TSource> selector)
      Invokes a transform function on each element of a sequence and returns the maximum Float value.
    • max

      public static <TSource> @Nullable Float max(Enumerable<TSource> source, NullableFloatFunction1<TSource> selector)
      Invokes a transform function on each element of a sequence and returns the maximum nullable Float value.
    • max

      public static <TSource, TResult extends Comparable<TResult>> @Nullable TResult max(Enumerable<TSource> source, Function1<TSource,TResult> selector)
      Invokes a transform function on each element of a generic sequence and returns the maximum resulting value.
    • min

      public static <TSource extends Comparable<TSource>> @Nullable TSource min(Enumerable<TSource> source)
      Returns the minimum value in a generic sequence.
    • min

      public static <TSource> BigDecimal min(Enumerable<TSource> source, BigDecimalFunction1<TSource> selector)
      Invokes a transform function on each element of a sequence and returns the minimum Decimal value.
    • min

      public static <TSource> BigDecimal min(Enumerable<TSource> source, NullableBigDecimalFunction1<TSource> selector)
      Invokes a transform function on each element of a sequence and returns the minimum nullable Decimal value.
    • min

      public static <TSource> double min(Enumerable<TSource> source, DoubleFunction1<TSource> selector)
      Invokes a transform function on each element of a sequence and returns the minimum Double value.
    • min

      public static <TSource> Double min(Enumerable<TSource> source, NullableDoubleFunction1<TSource> selector)
      Invokes a transform function on each element of a sequence and returns the minimum nullable Double value.
    • min

      public static <TSource> int min(Enumerable<TSource> source, IntegerFunction1<TSource> selector)
      Invokes a transform function on each element of a sequence and returns the minimum int value.
    • min

      public static <TSource> Integer min(Enumerable<TSource> source, NullableIntegerFunction1<TSource> selector)
      Invokes a transform function on each element of a sequence and returns the minimum nullable int value. (Defined by Enumerable.)
    • min

      public static <TSource> long min(Enumerable<TSource> source, LongFunction1<TSource> selector)
      Invokes a transform function on each element of a sequence and returns the minimum long value.
    • min

      public static <TSource> Long min(Enumerable<TSource> source, NullableLongFunction1<TSource> selector)
      Invokes a transform function on each element of a sequence and returns the minimum nullable long value. (Defined by Enumerable.)
    • min

      public static <TSource> float min(Enumerable<TSource> source, FloatFunction1<TSource> selector)
      Invokes a transform function on each element of a sequence and returns the minimum Float value.
    • min

      public static <TSource> Float min(Enumerable<TSource> source, NullableFloatFunction1<TSource> selector)
      Invokes a transform function on each element of a sequence and returns the minimum nullable Float value.
    • min

      public static <TSource, TResult extends Comparable<TResult>> @Nullable TResult min(Enumerable<TSource> source, Function1<TSource,TResult> selector)
      Invokes a transform function on each element of a generic sequence and returns the minimum resulting value.
    • ofType

      public static <TSource, TResult> Enumerable<TResult> ofType(Enumerable<TSource> enumerable, Class<TResult> clazz)
      Filters the elements of an Enumerable based on a specified type.

      Analogous to LINQ's Enumerable.OfType extension method.

      Type Parameters:
      TResult - Target type
      Parameters:
      clazz - Target type
      Returns:
      Collection of T2
    • orderBy

      public static <TSource, TKey extends Comparable> Enumerable<TSource> orderBy(Enumerable<TSource> source, Function1<TSource,TKey> keySelector)
      Sorts the elements of a sequence in ascending order according to a key.
    • orderBy

      public static <TSource, TKey> Enumerable<TSource> orderBy(Enumerable<TSource> source, Function1<TSource,TKey> keySelector, @Nullable Comparator<TKey> comparator)
      Sorts the elements of a sequence in ascending order by using a specified comparer.
    • orderBy

      public static <TSource, TKey> Enumerable<TSource> orderBy(Enumerable<TSource> source, Function1<TSource,TKey> keySelector, Comparator<TKey> comparator, int offset, int fetch)
      A sort implementation optimized for a sort with a fetch size (LIMIT).
      Parameters:
      offset - how many rows are skipped from the sorted output. Must be greater than or equal to 0.
      fetch - how many rows are retrieved. Must be greater than or equal to 0.
    • orderByDescending

      public static <TSource, TKey extends Comparable> Enumerable<TSource> orderByDescending(Enumerable<TSource> source, Function1<TSource,TKey> keySelector)
      Sorts the elements of a sequence in descending order according to a key.
    • orderByDescending

      public static <TSource, TKey> Enumerable<TSource> orderByDescending(Enumerable<TSource> source, Function1<TSource,TKey> keySelector, Comparator<TKey> comparator)
      Sorts the elements of a sequence in descending order by using a specified comparer.
    • reverse

      public static <TSource> Enumerable<TSource> reverse(Enumerable<TSource> source)
      Inverts the order of the elements in a sequence.
    • select

      public static <TSource, TResult> Enumerable<TResult> select(Enumerable<TSource> source, Function1<TSource,TResult> selector)
      Projects each element of a sequence into a new form.
    • select

      public static <TSource, TResult> Enumerable<TResult> select(Enumerable<TSource> source, Function2<TSource,Integer,TResult> selector)
      Projects each element of a sequence into a new form by incorporating the element's index.
    • selectMany

      public static <TSource, TResult> Enumerable<TResult> selectMany(Enumerable<TSource> source, Function1<TSource,Enumerable<TResult>> selector)
      Projects each element of a sequence to an Enumerable<TSource> and flattens the resulting sequences into one sequence.
    • selectMany

      public static <TSource, TResult> Enumerable<TResult> selectMany(Enumerable<TSource> source, Function2<TSource,Integer,Enumerable<TResult>> selector)
      Projects each element of a sequence to an Enumerable<TSource>, and flattens the resulting sequences into one sequence. The index of each source element is used in the projected form of that element.
    • selectMany

      public static <TSource, TCollection, TResult> Enumerable<TResult> selectMany(Enumerable<TSource> source, Function2<TSource,Integer,Enumerable<TCollection>> collectionSelector, Function2<TSource,TCollection,TResult> resultSelector)
      Projects each element of a sequence to an Enumerable<TSource>, flattens the resulting sequences into one sequence, and invokes a result selector function on each element therein. The index of each source element is used in the intermediate projected form of that element.
    • selectMany

      public static <TSource, TCollection, TResult> Enumerable<TResult> selectMany(Enumerable<TSource> source, Function1<TSource,Enumerable<TCollection>> collectionSelector, Function2<TSource,TCollection,TResult> resultSelector)
      Projects each element of a sequence to an Enumerable<TSource>, flattens the resulting sequences into one sequence, and invokes a result selector function on each element therein.
    • sequenceEqual

      public static <TSource> boolean sequenceEqual(Enumerable<TSource> first, Enumerable<TSource> second)
      Determines whether two sequences are equal by comparing the elements by using the default equality comparer for their type.
    • sequenceEqual

      public static <TSource> boolean sequenceEqual(Enumerable<TSource> first, Enumerable<TSource> second, @Nullable EqualityComparer<TSource> comparer)
      Determines whether two sequences are equal by comparing their elements by using a specified EqualityComparer<TSource>.
    • single

      public static <TSource> TSource single(Enumerable<TSource> source)
      Returns the only element of a sequence, and throws an exception if there is not exactly one element in the sequence.
    • single

      public static <TSource> TSource single(Enumerable<TSource> source, Predicate1<TSource> predicate)
      Returns the only element of a sequence that satisfies a specified condition, and throws an exception if more than one such element exists.
    • singleOrDefault

      public static <TSource> @Nullable TSource singleOrDefault(Enumerable<TSource> source)
      Returns the only element of a sequence, or a default value if the sequence is empty; this method throws an exception if there is more than one element in the sequence.
    • singleOrDefault

      public static <TSource> @Nullable TSource singleOrDefault(Enumerable<TSource> source, Predicate1<TSource> predicate)
      Returns the only element of a sequence that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition.
    • skip

      public static <TSource> Enumerable<TSource> skip(Enumerable<TSource> source, int count)
      Bypasses a specified number of elements in a sequence and then returns the remaining elements.
    • skipWhile

      public static <TSource> Enumerable<TSource> skipWhile(Enumerable<TSource> source, Predicate1<TSource> predicate)
      Bypasses elements in a sequence as long as a specified condition is true and then returns the remaining elements.
    • skipWhile

      public static <TSource> Enumerable<TSource> skipWhile(Enumerable<TSource> source, Predicate2<TSource,Integer> predicate)
      Bypasses elements in a sequence as long as a specified condition is true and then returns the remaining elements. The element's index is used in the logic of the predicate function.
    • sum

      public static <TSource> BigDecimal sum(Enumerable<TSource> source, BigDecimalFunction1<TSource> selector)
      Computes the sum of the sequence of Decimal values that are obtained by invoking a transform function on each element of the input sequence.
    • sum

      public static <TSource> BigDecimal sum(Enumerable<TSource> source, NullableBigDecimalFunction1<TSource> selector)
      Computes the sum of the sequence of nullable Decimal values that are obtained by invoking a transform function on each element of the input sequence.
    • sum

      public static <TSource> double sum(Enumerable<TSource> source, DoubleFunction1<TSource> selector)
      Computes the sum of the sequence of Double values that are obtained by invoking a transform function on each element of the input sequence.
    • sum

      public static <TSource> Double sum(Enumerable<TSource> source, NullableDoubleFunction1<TSource> selector)
      Computes the sum of the sequence of nullable Double values that are obtained by invoking a transform function on each element of the input sequence.
    • sum

      public static <TSource> int sum(Enumerable<TSource> source, IntegerFunction1<TSource> selector)
      Computes the sum of the sequence of int values that are obtained by invoking a transform function on each element of the input sequence.
    • sum

      public static <TSource> Integer sum(Enumerable<TSource> source, NullableIntegerFunction1<TSource> selector)
      Computes the sum of the sequence of nullable int values that are obtained by invoking a transform function on each element of the input sequence.
    • sum

      public static <TSource> long sum(Enumerable<TSource> source, LongFunction1<TSource> selector)
      Computes the sum of the sequence of long values that are obtained by invoking a transform function on each element of the input sequence.
    • sum

      public static <TSource> Long sum(Enumerable<TSource> source, NullableLongFunction1<TSource> selector)
      Computes the sum of the sequence of nullable long values that are obtained by invoking a transform function on each element of the input sequence.
    • sum

      public static <TSource> float sum(Enumerable<TSource> source, FloatFunction1<TSource> selector)
      Computes the sum of the sequence of Float values that are obtained by invoking a transform function on each element of the input sequence.
    • sum

      public static <TSource> Float sum(Enumerable<TSource> source, NullableFloatFunction1<TSource> selector)
      Computes the sum of the sequence of nullable Float values that are obtained by invoking a transform function on each element of the input sequence.
    • take

      public static <TSource> Enumerable<TSource> take(Enumerable<TSource> source, int count)
      Returns a specified number of contiguous elements from the start of a sequence.
    • take

      public static <TSource> Enumerable<TSource> take(Enumerable<TSource> source, long count)
      Returns a specified number of contiguous elements from the start of a sequence.
    • takeWhile

      public static <TSource> Enumerable<TSource> takeWhile(Enumerable<TSource> source, Predicate1<TSource> predicate)
      Returns elements from a sequence as long as a specified condition is true.
    • takeWhile

      public static <TSource> Enumerable<TSource> takeWhile(Enumerable<TSource> source, Predicate2<TSource,Integer> predicate)
      Returns elements from a sequence as long as a specified condition is true. The element's index is used in the logic of the predicate function.
    • takeWhileLong

      public static <TSource> Enumerable<TSource> takeWhileLong(Enumerable<TSource> source, Predicate2<TSource,Long> predicate)
      Returns elements from a sequence as long as a specified condition is true. The element's index is used in the logic of the predicate function.
    • createOrderedEnumerable

      public static <TSource, TKey> OrderedEnumerable<TSource> createOrderedEnumerable(OrderedEnumerable<TSource> source, Function1<TSource,TKey> keySelector, Comparator<TKey> comparator, boolean descending)
      Performs a subsequent ordering of the elements in a sequence according to a key.
    • thenBy

      public static <TSource, TKey extends Comparable<TKey>> OrderedEnumerable<TSource> thenBy(OrderedEnumerable<TSource> source, Function1<TSource,TKey> keySelector)
      Performs a subsequent ordering of the elements in a sequence in ascending order according to a key.
    • thenBy

      public static <TSource, TKey> OrderedEnumerable<TSource> thenBy(OrderedEnumerable<TSource> source, Function1<TSource,TKey> keySelector, Comparator<TKey> comparator)
      Performs a subsequent ordering of the elements in a sequence in ascending order according to a key, using a specified comparator.
    • thenByDescending

      public static <TSource, TKey extends Comparable<TKey>> OrderedEnumerable<TSource> thenByDescending(OrderedEnumerable<TSource> source, Function1<TSource,TKey> keySelector)
      Performs a subsequent ordering of the elements in a sequence in descending order according to a key.
    • thenByDescending

      public static <TSource, TKey> OrderedEnumerable<TSource> thenByDescending(OrderedEnumerable<TSource> source, Function1<TSource,TKey> keySelector, Comparator<TKey> comparator)
      Performs a subsequent ordering of the elements in a sequence in descending order according to a key, using a specified comparator.
    • toMap

      public static <TSource, TKey> Map<TKey,TSource> toMap(Enumerable<TSource> source, Function1<TSource,TKey> keySelector)
      Creates a Map<TKey, TValue> from an Enumerable<TSource> according to a specified key selector function.

      NOTE: Called toDictionary in LINQ.NET.

    • toMap

      public static <TSource, TKey> Map<TKey,TSource> toMap(Enumerable<TSource> source, Function1<TSource,TKey> keySelector, EqualityComparer<TKey> comparer)
      Creates a Map<TKey, TValue> from an Enumerable<TSource> according to a specified key selector function and key comparer.
    • toMap

      public static <TSource, TKey, TElement> Map<TKey,TElement> toMap(Enumerable<TSource> source, Function1<TSource,TKey> keySelector, Function1<TSource,TElement> elementSelector)
      Creates a Map<TKey, TValue> from an Enumerable<TSource> according to specified key selector and element selector functions.
    • toMap

      public static <TSource, TKey, TElement> Map<TKey,TElement> toMap(Enumerable<TSource> source, Function1<TSource,TKey> keySelector, Function1<TSource,TElement> elementSelector, EqualityComparer<TKey> comparer)
      Creates a Map<TKey, TValue> from an Enumerable<TSource> according to a specified key selector function, a comparer, and an element selector function.
    • toList

      public static <TSource> List<TSource> toList(Enumerable<TSource> source)
      Creates a List<TSource> from an Enumerable<TSource>.
    • toLookup

      public static <TSource, TKey> Lookup<TKey,TSource> toLookup(Enumerable<TSource> source, Function1<TSource,TKey> keySelector)
      Creates a Lookup<TKey, TElement> from an Enumerable<TSource> according to a specified key selector function.
    • toLookup

      public static <TSource, TKey> Lookup<TKey,TSource> toLookup(Enumerable<TSource> source, Function1<TSource,TKey> keySelector, EqualityComparer<TKey> comparer)
      Creates a Lookup<TKey, TElement> from an Enumerable<TSource> according to a specified key selector function and key comparer.
    • toLookup

      public static <TSource, TKey, TElement> Lookup<TKey,TElement> toLookup(Enumerable<TSource> source, Function1<TSource,TKey> keySelector, Function1<TSource,TElement> elementSelector)
      Creates a Lookup<TKey, TElement> from an Enumerable<TSource> according to specified key selector and element selector functions.
    • toLookup

      public static <TSource, TKey, TElement> Lookup<TKey,TElement> toLookup(Enumerable<TSource> source, Function1<TSource,TKey> keySelector, Function1<TSource,TElement> elementSelector, EqualityComparer<TKey> comparer)
      Creates a Lookup<TKey, TElement> from an Enumerable<TSource> according to a specified key selector function, a comparer and an element selector function.
    • union

      public static <TSource> Enumerable<TSource> union(Enumerable<TSource> source0, Enumerable<TSource> source1)
      Produces the set union of two sequences by using the default equality comparer.
    • union

      public static <TSource> Enumerable<TSource> union(Enumerable<TSource> source0, Enumerable<TSource> source1, EqualityComparer<TSource> comparer)
      Produces the set union of two sequences by using a specified EqualityComparer<TSource>.
    • where

      public static <TSource> Enumerable<TSource> where(Enumerable<TSource> source, Predicate1<TSource> predicate)
      Filters a sequence of values based on a predicate.
    • where

      public static <TSource> Enumerable<TSource> where(Enumerable<TSource> source, Predicate2<TSource,Integer> predicate)
      Filters a sequence of values based on a predicate. Each element's index is used in the logic of the predicate function.
    • zip

      public static <T0, T1, TResult> Enumerable<TResult> zip(Enumerable<T0> first, Enumerable<T1> second, Function2<T0,T1,TResult> resultSelector)
      Applies a specified function to the corresponding elements of two sequences, producing a sequence of the results.
    • asOrderedQueryable

      public static <T> OrderedQueryable<T> asOrderedQueryable(Enumerable<T> source)
    • into

      public static <T, C extends Collection<? super T>> C into(Enumerable<T> source, C sink)
      Default implementation of ExtendedEnumerable.into(Collection).
    • remove

      public static <T, C extends Collection<? super T>> C remove(Enumerable<T> source, C sink)
      Default implementation of ExtendedEnumerable.removeAll(Collection).
    • compareNullsLastForMergeJoin

      public static int compareNullsLastForMergeJoin(@Nullable Comparable v0, @Nullable Comparable v1)
    • compareNullsLastForMergeJoin

      public static int compareNullsLastForMergeJoin(@Nullable Comparable v0, @Nullable Comparable v1, @Nullable Comparator comparator)
    • repeatUnion

      public static <TSource> Enumerable<TSource> repeatUnion(Enumerable<TSource> seed, Enumerable<TSource> iteration, int iterationLimit, boolean all, EqualityComparer<TSource> comparer, @Nullable Function0<Boolean> cleanUpFunction)
      Repeat Union enumerable. Evaluates the seed enumerable once, and then starts to evaluate the iteration enumerable over and over, until either it returns no results, or it reaches an optional maximum number of iterations.
      Type Parameters:
      TSource - record type
      Parameters:
      seed - seed enumerable
      iteration - iteration enumerable
      iterationLimit - maximum numbers of repetitions for the iteration enumerable (negative value means no limit)
      all - whether duplicates will be considered or not
      comparer - EqualityComparer to control duplicates, only used if all is false
      cleanUpFunction - optional clean-up actions (e.g. delete temporary table)
    • lazyCollectionSpool

      public static <TSource> Enumerable<TSource> lazyCollectionSpool(Collection<TSource> outputCollection, Enumerable<TSource> input)
      Lazy read and lazy write spool that stores data into a collection.
    • mergeUnion

      public static <TSource, TKey> Enumerable<TSource> mergeUnion(List<Enumerable<TSource>> sources, Function1<TSource,TKey> sortKeySelector, Comparator<TKey> sortComparator, boolean all, EqualityComparer<TSource> equalityComparer)
      Merge Union Enumerable. Performs a union (or union all) of all its inputs (which must be already sorted), respecting the order.
      Type Parameters:
      TSource - record type
      TKey - sort key
      Parameters:
      sources - input enumerables (must be already sorted)
      sortKeySelector - sort key selector
      sortComparator - sort comparator to decide the next item
      all - whether duplicates will be considered or not
      equalityComparer - EqualityComparer to control duplicates, only used if all is false