Class EnumerableDefaults


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

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <TSource> TSource aggregate​(Enumerable<TSource> source, Function2<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 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> asOrderedQueryable​(Enumerable<T> source)  
      static <TSource> Queryable<TSource> asQueryable​(Enumerable<TSource> enumerable)
      Converts an Enumerable to an IQueryable.
      static <TSource> java.math.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> java.math.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> java.lang.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> java.lang.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> java.lang.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> java.lang.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, java.lang.Class<T2> clazz)
      Analogous to LINQ's Enumerable.Cast extension method.
      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>
      correlateJoin​(CorrelateJoinType joinType, Enumerable<TSource> outer, Function1<TSource,​Enumerable<TInner>> inner, Function2<TSource,​TInner,​TResult> resultSelector)
      Returns elements of outer for which there is a member of inner with a matching key.
      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, java.util.Comparator<TKey> comparator, boolean descending)
      Performs a subsequent ordering of the elements in a sequence according to a key.
      static <TSource> Enumerable<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<TSource> defaultIfEmpty​(Enumerable<TSource> enumerable, 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> 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.
      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.
      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> TSource firstOrDefault​(Enumerable<TSource> enumerable)
      Returns the first element of a sequence, or a default value if the sequence contains no elements.
      static <TSource> 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.
      private static <TSource,​TKey,​TAccumulate,​TResult>
      Enumerable<TResult>
      groupBy_​(java.util.Map<TKey,​TAccumulate> map, Enumerable<TSource> enumerable, Function1<TSource,​TKey> keySelector, Function0<TAccumulate> accumulatorInitializer, Function2<TAccumulate,​TSource,​TAccumulate> accumulatorAdder, Function2<TKey,​TAccumulate,​TResult> resultSelector)  
      private static <TSource,​TKey,​TResult>
      Enumerable<TResult>
      groupBy_​(java.util.Set<TKey> map, Enumerable<TSource> enumerable, Function1<TSource,​TKey> keySelector, Function1<TKey,​TResult> resultSelector)  
      static <TSource,​TKey,​TAccumulate,​TResult>
      Enumerable<TResult>
      groupByMultiple​(Enumerable<TSource> enumerable, java.util.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.
      private static <TSource,​TKey,​TAccumulate,​TResult>
      Enumerable<TResult>
      groupByMultiple_​(java.util.Map<TKey,​TAccumulate> map, Enumerable<TSource> enumerable, java.util.List<Function1<TSource,​TKey>> keySelectors, Function0<TAccumulate> accumulatorInitializer, Function2<TAccumulate,​TSource,​TAccumulate> accumulatorAdder, Function2<TKey,​TAccumulate,​TResult> resultSelector)  
      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> 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.
      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.
      static <T,​C extends java.util.Collection<? super T>>
      C
      into​(Enumerable<T> source, C sink)
      Default implementation of ExtendedEnumerable.into(Collection).
      static <TSource,​TInner,​TKey,​TResult>
      Enumerable<TResult>
      join​(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>
      join​(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,​TInner,​TKey,​TResult>
      Enumerable<TResult>
      join​(Enumerable<TSource> outer, Enumerable<TInner> inner, Function1<TSource,​TKey> outerKeySelector, Function1<TInner,​TKey> innerKeySelector, Function2<TSource,​TInner,​TResult> resultSelector, EqualityComparer<TKey> comparer, boolean generateNullsOnLeft, boolean generateNullsOnRight)
      Correlates the elements of two sequences based on matching keys.
      private static <TSource,​TInner,​TKey,​TResult>
      Enumerable<TResult>
      join_​(Enumerable<TSource> outer, Enumerable<TInner> inner, Function1<TSource,​TKey> outerKeySelector, Function1<TInner,​TKey> innerKeySelector, Function2<TSource,​TInner,​TResult> resultSelector, EqualityComparer<TKey> comparer, boolean generateNullsOnLeft, boolean generateNullsOnRight)
      Implementation of join that builds the right input and probes with the left.
      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> TSource lastOrDefault​(Enumerable<TSource> enumerable)
      Returns the last element of a sequence, or a default value if the sequence contains no elements.
      static <TSource> 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> 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 java.lang.Comparable<TSource>>
      TSource
      max​(Enumerable<TSource> source)
      Returns the maximum value in a generic sequence.
      static <TSource> java.math.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 java.lang.Comparable<TResult>>
      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> java.math.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> java.lang.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> java.lang.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> java.lang.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> java.lang.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.
      private static <TSource extends java.lang.Comparable<TSource>>
      Function2<TSource,​TSource,​TSource>
      maxFunction()  
      static <TSource,​TInner,​TKey extends java.lang.Comparable<TKey>,​TResult>
      Enumerable<TResult>
      mergeJoin​(Enumerable<TSource> outer, Enumerable<TInner> inner, Function1<TSource,​TKey> outerKeySelector, Function1<TInner,​TKey> innerKeySelector, Function2<TSource,​TInner,​TResult> resultSelector, boolean generateNullsOnLeft, boolean generateNullsOnRight)
      Joins two inputs that are sorted on the key.
      static <TSource extends java.lang.Comparable<TSource>>
      TSource
      min​(Enumerable<TSource> source)
      Returns the minimum value in a generic sequence.
      static <TSource> java.math.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 java.lang.Comparable<TResult>>
      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> java.math.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> java.lang.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> java.lang.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> java.lang.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> java.lang.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.
      private static <TSource extends java.lang.Comparable<TSource>>
      Function2<TSource,​TSource,​TSource>
      minFunction()  
      static <TSource,​TResult>
      Enumerable<TResult>
      ofType​(Enumerable<TSource> enumerable, java.lang.Class<TResult> clazz)
      Filters the elements of an Enumerable based on a specified type.
      static <TSource,​TKey extends java.lang.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, java.util.Comparator<TKey> comparator)
      Sorts the elements of a sequence in ascending order by using a specified comparer.
      static <TSource,​TKey extends java.lang.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, java.util.Comparator<TKey> comparator)
      Sorts the elements of a sequence in descending order by using a specified comparer.
      static <T,​C extends java.util.Collection<? super T>>
      C
      remove​(Enumerable<T> source, C sink)
      Default implementation of ExtendedEnumerable.removeAll(Collection).
      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,​java.lang.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,​java.lang.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,​java.lang.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)
      Returns elements of outer for which there is a member of inner with a matching key.
      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, 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> 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> 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,​java.lang.Integer> predicate)
      Bypasses elements in a sequence as long as a specified condition is true and then returns the remaining elements.
      static <TSource> java.math.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> java.math.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> java.lang.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> java.lang.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> java.lang.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> java.lang.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,​java.lang.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,​java.lang.Long> predicate)
      Returns elements from a sequence as long as a specified condition is true.
      static <TSource,​TKey extends java.lang.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, java.util.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 java.lang.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, java.util.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,​TInner,​TResult>
      Enumerable<TResult>
      thetaJoin​(Enumerable<TSource> outer, Enumerable<TInner> inner, Predicate2<TSource,​TInner> predicate, Function2<TSource,​TInner,​TResult> resultSelector, boolean generateNullsOnLeft, boolean generateNullsOnRight)
      Correlates the elements of two sequences based on a predicate.
      static <TSource> java.util.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.
      (package private) static <TSource,​TKey,​TElement>
      LookupImpl<TKey,​TElement>
      toLookup_​(java.util.Map<TKey,​java.util.List<TElement>> map, Enumerable<TSource> source, Function1<TSource,​TKey> keySelector, Function1<TSource,​TElement> elementSelector)  
      static <TSource,​TKey>
      java.util.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>
      java.util.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>
      java.util.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>
      java.util.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>.
      private static <TSource> Function1<EnumerableDefaults.Wrapped<TSource>,​TSource> unwrapper()  
      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,​java.lang.Integer> predicate)
      Filters a sequence of values based on a predicate.
      private static <TSource> Enumerator<TSource> where​(Enumerator<TSource> enumerator, Predicate1<TSource> predicate)  
      private static <TSource> Function1<TSource,​EnumerableDefaults.Wrapped<TSource>> wrapperFor​(EqualityComparer<TSource> comparer)  
      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 Detail

      • EnumerableDefaults

        public EnumerableDefaults()
    • Method Detail

      • aggregate

        public static <TSource> TSource aggregate​(Enumerable<TSource> source,
                                                  Function2<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> java.math.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> java.math.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> java.lang.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> java.lang.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> java.lang.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> java.lang.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,
                                                             java.lang.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<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<TSource> defaultIfEmpty​(Enumerable<TSource> enumerable,
                                                                   TSource value)
        Returns the elements of the specified sequence or the specified value in a singleton collection if the sequence is empty.
      • distinct

        public static <TSource> Enumerable<TSource> distinct​(Enumerable<TSource> enumerable)
        Returns distinct elements from a sequence by using the default 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> 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. (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.
      • 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> 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> 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,
                                                                                                               java.util.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.
      • groupBy_

        private static <TSource,​TKey,​TAccumulate,​TResult> Enumerable<TResult> groupBy_​(java.util.Map<TKey,​TAccumulate> map,
                                                                                                         Enumerable<TSource> enumerable,
                                                                                                         Function1<TSource,​TKey> keySelector,
                                                                                                         Function0<TAccumulate> accumulatorInitializer,
                                                                                                         Function2<TAccumulate,​TSource,​TAccumulate> accumulatorAdder,
                                                                                                         Function2<TKey,​TAccumulate,​TResult> resultSelector)
      • groupByMultiple_

        private static <TSource,​TKey,​TAccumulate,​TResult> Enumerable<TResult> groupByMultiple_​(java.util.Map<TKey,​TAccumulate> map,
                                                                                                                 Enumerable<TSource> enumerable,
                                                                                                                 java.util.List<Function1<TSource,​TKey>> keySelectors,
                                                                                                                 Function0<TAccumulate> accumulatorInitializer,
                                                                                                                 Function2<TAccumulate,​TSource,​TAccumulate> accumulatorAdder,
                                                                                                                 Function2<TKey,​TAccumulate,​TResult> resultSelector)
      • groupBy_

        private static <TSource,​TKey,​TResult> Enumerable<TResult> groupBy_​(java.util.Set<TKey> map,
                                                                                       Enumerable<TSource> enumerable,
                                                                                       Function1<TSource,​TKey> keySelector,
                                                                                       Function1<TKey,​TResult> resultSelector)
      • 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. (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.
      • join

        public static <TSource,​TInner,​TKey,​TResult> Enumerable<TResult> join​(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.
      • join

        public static <TSource,​TInner,​TKey,​TResult> Enumerable<TResult> join​(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.
      • join

        public static <TSource,​TInner,​TKey,​TResult> Enumerable<TResult> join​(Enumerable<TSource> outer,
                                                                                               Enumerable<TInner> inner,
                                                                                               Function1<TSource,​TKey> outerKeySelector,
                                                                                               Function1<TInner,​TKey> innerKeySelector,
                                                                                               Function2<TSource,​TInner,​TResult> resultSelector,
                                                                                               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.
      • join_

        private static <TSource,​TInner,​TKey,​TResult> Enumerable<TResult> join_​(Enumerable<TSource> outer,
                                                                                                 Enumerable<TInner> inner,
                                                                                                 Function1<TSource,​TKey> outerKeySelector,
                                                                                                 Function1<TInner,​TKey> innerKeySelector,
                                                                                                 Function2<TSource,​TInner,​TResult> resultSelector,
                                                                                                 EqualityComparer<TKey> comparer,
                                                                                                 boolean generateNullsOnLeft,
                                                                                                 boolean generateNullsOnRight)
        Implementation of join that builds the right input and probes with the left.
      • correlateJoin

        public static <TSource,​TInner,​TResult> Enumerable<TResult> correlateJoin​(CorrelateJoinType joinType,
                                                                                             Enumerable<TSource> outer,
                                                                                             Function1<TSource,​Enumerable<TInner>> inner,
                                                                                             Function2<TSource,​TInner,​TResult> resultSelector)
        Returns elements of outer for which there is a member of inner with a matching key. A specified EqualityComparer<TSource> is used to compare keys.
      • last

        public static <TSource> TSource last​(Enumerable<TSource> enumerable)
        Returns the last element of a sequence. (Defined by Enumerable.)
      • 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)
        Returns elements of outer for which there is a member of inner with a matching key. A specified EqualityComparer<TSource> is used to compare keys.
      • thetaJoin

        public static <TSource,​TInner,​TResult> Enumerable<TResult> thetaJoin​(Enumerable<TSource> outer,
                                                                                         Enumerable<TInner> inner,
                                                                                         Predicate2<TSource,​TInner> predicate,
                                                                                         Function2<TSource,​TInner,​TResult> resultSelector,
                                                                                         boolean generateNullsOnLeft,
                                                                                         boolean generateNullsOnRight)
        Correlates the elements of two sequences based on a predicate.
      • mergeJoin

        public static <TSource,​TInner,​TKey extends java.lang.Comparable<TKey>,​TResult> Enumerable<TResult> mergeJoin​(Enumerable<TSource> outer,
                                                                                                                                       Enumerable<TInner> inner,
                                                                                                                                       Function1<TSource,​TKey> outerKeySelector,
                                                                                                                                       Function1<TInner,​TKey> innerKeySelector,
                                                                                                                                       Function2<TSource,​TInner,​TResult> resultSelector,
                                                                                                                                       boolean generateNullsOnLeft,
                                                                                                                                       boolean generateNullsOnRight)
        Joins two inputs that are sorted on the key.
      • 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> 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> 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 java.lang.Comparable<TSource>> TSource max​(Enumerable<TSource> source)
        Returns the maximum value in a generic sequence.
      • max

        public static <TSource> java.math.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> java.math.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> java.lang.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> java.lang.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> java.lang.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> java.lang.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 java.lang.Comparable<TResult>> 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 java.lang.Comparable<TSource>> TSource min​(Enumerable<TSource> source)
        Returns the minimum value in a generic sequence.
      • minFunction

        private static <TSource extends java.lang.Comparable<TSource>> Function2<TSource,​TSource,​TSource> minFunction()
      • maxFunction

        private static <TSource extends java.lang.Comparable<TSource>> Function2<TSource,​TSource,​TSource> maxFunction()
      • min

        public static <TSource> java.math.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> java.math.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> java.lang.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> java.lang.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> java.lang.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> java.lang.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 java.lang.Comparable<TResult>> 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,
                                                                         java.lang.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 java.lang.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,
                                                                       java.util.Comparator<TKey> comparator)
        Sorts the elements of a sequence in ascending order by using a specified comparer.
      • orderByDescending

        public static <TSource,​TKey extends java.lang.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,
                                                                                 java.util.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,​java.lang.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,​java.lang.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,​java.lang.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,
                                                      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> 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> 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,​java.lang.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> java.math.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> java.math.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> java.lang.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> java.lang.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> java.lang.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> java.lang.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,​java.lang.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,​java.lang.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,
                                                                                              java.util.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 java.lang.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,
                                                                             java.util.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 java.lang.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,
                                                                                       java.util.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> java.util.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> java.util.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> java.util.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> java.util.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> java.util.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_

        static <TSource,​TKey,​TElement> LookupImpl<TKey,​TElement> toLookup_​(java.util.Map<TKey,​java.util.List<TElement>> map,
                                                                                             Enumerable<TSource> source,
                                                                                             Function1<TSource,​TKey> keySelector,
                                                                                             Function1<TSource,​TElement> elementSelector)
      • 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,​java.lang.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.