Class DefaultEnumerable<T>
- java.lang.Object
-
- org.apache.calcite.linq4j.DefaultEnumerable<T>
-
- Type Parameters:
T
- Element type
- All Implemented Interfaces:
java.lang.Iterable<T>
,Enumerable<T>
,ExtendedEnumerable<T>
,ExtendedOrderedEnumerable<T>
,OrderedEnumerable<T>
,RawEnumerable<T>
- Direct Known Subclasses:
AbstractEnumerable
,AbstractEnumerable2
,DefaultQueryable
,EnumerableQueryable
public abstract class DefaultEnumerable<T> extends java.lang.Object implements OrderedEnumerable<T>
Implementation of theEnumerable
interface that implements the extension methods by calling into theExtensions
class.The are two abstract methods:
RawEnumerable.enumerator()
andIterable.iterator()
. The derived class can implement each separately, or implement one in terms of the other.
-
-
Constructor Summary
Constructors Constructor Description DefaultEnumerable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
aggregate(Function2<T,T,T> func)
Applies an accumulator function over a sequence.<TAccumulate>
TAccumulateaggregate(TAccumulate seed, Function2<TAccumulate,T,TAccumulate> func)
Applies an accumulator function over a sequence.<TAccumulate,TResult>
TResultaggregate(TAccumulate seed, Function2<TAccumulate,T,TAccumulate> func, Function1<TAccumulate,TResult> selector)
Applies an accumulator function over a sequence.boolean
all(Predicate1<T> predicate)
Determines whether all elements of a sequence satisfy a condition.boolean
any()
Determines whether a sequence contains any elements.boolean
any(Predicate1<T> predicate)
Determines whether any element of a sequence satisfies a condition.Enumerable<T>
asEnumerable()
Returns the input typed asEnumerable<TSource>
.protected OrderedQueryable<T>
asOrderedQueryable()
Queryable<T>
asQueryable()
Converts this Enumerable to a Queryable.java.math.BigDecimal
average(BigDecimalFunction1<T> 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.double
average(DoubleFunction1<T> 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.float
average(FloatFunction1<T> 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.int
average(IntegerFunction1<T> 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.long
average(LongFunction1<T> 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.java.math.BigDecimal
average(NullableBigDecimalFunction1<T> 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.java.lang.Double
average(NullableDoubleFunction1<T> 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.java.lang.Float
average(NullableFloatFunction1<T> 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.java.lang.Integer
average(NullableIntegerFunction1<T> 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.java.lang.Long
average(NullableLongFunction1<T> 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.<T2> Enumerable<T2>
cast(java.lang.Class<T2> clazz)
Converts the elements of this Enumerable to the specified type.Enumerable<T>
concat(Enumerable<T> enumerable1)
Concatenates two sequences.boolean
contains(T element)
Determines whether a sequence contains a specified element by using the default equality comparer.boolean
contains(T element, EqualityComparer<T> comparer)
Determines whether a sequence contains a specified element by using a specifiedEqualityComparer<TSource>
.<TInner,TResult>
Enumerable<TResult>correlateJoin(CorrelateJoinType joinType, Function1<T,Enumerable<TInner>> inner, Function2<T,TInner,TResult> resultSelector)
For each row of the current enumerable returns the correlated rows from theinner
enumerable (nested loops join).int
count()
Returns the number of elements in a sequence.int
count(Predicate1<T> predicate)
Returns a number that represents how many elements in the specified sequence satisfy a condition.<TKey> OrderedEnumerable<T>
createOrderedEnumerable(Function1<T,TKey> keySelector, java.util.Comparator<TKey> comparator, boolean descending)
Performs a subsequent ordering of the elements in anOrderedEnumerable
according to a key, using a specified comparator.Enumerable<T>
defaultIfEmpty()
Returns the elements of the specified sequence or the type parameter's default value in a singleton collection if the sequence is empty.Enumerable<T>
defaultIfEmpty(T value)
Returns the elements of the specified sequence or the specified value in a singleton collection if the sequence is empty.Enumerable<T>
distinct()
Returns distinct elements from a sequence by using the default equality comparer to compare values.Enumerable<T>
distinct(EqualityComparer<T> comparer)
Returns distinct elements from a sequence by using a specifiedEqualityComparer<TSource>
to compare values.T
elementAt(int index)
Returns the element at a specified index in a sequence.T
elementAtOrDefault(int index)
Returns the element at a specified index in a sequence or a default value if the index is out of range.Enumerable<T>
except(Enumerable<T> enumerable1)
Produces the set difference of two sequences by using the default equality comparer to compare values.Enumerable<T>
except(Enumerable<T> enumerable1, EqualityComparer<T> comparer)
Produces the set difference of two sequences by using the specifiedEqualityComparer<TSource>
to compare values.T
first()
Returns the first element of a sequence.T
first(Predicate1<T> predicate)
Returns the first element in a sequence that satisfies a specified condition.T
firstOrDefault()
Returns the first element of a sequence, or a default value if the sequence contains no elements.T
firstOrDefault(Predicate1<T> predicate)
Returns the first element of the sequence that satisfies a condition or a default value if no such element is found.<R> R
foreach(Function1<T,R> func)
Performs an operation for each member of this enumeration.protected Enumerable<T>
getThis()
Derived classes might wish to override this method to return the "outer" enumerable.protected OrderedEnumerable<T>
getThisOrdered()
Derived classes might wish to override this method to return the "outer" ordered-enumerable.<TKey> Enumerable<Grouping<TKey,T>>
groupBy(Function1<T,TKey> keySelector)
Groups the elements of a sequence according to a specified key selector function.<TKey> Enumerable<Grouping<TKey,T>>
groupBy(Function1<T,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.<TKey,TAccumulate,TResult>
Enumerable<TResult>groupBy(Function1<T,TKey> keySelector, Function0<TAccumulate> accumulatorInitializer, Function2<TAccumulate,T,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.<TKey,TAccumulate,TResult>
Enumerable<TResult>groupBy(Function1<T,TKey> keySelector, Function0<TAccumulate> accumulatorInitializer, Function2<TAccumulate,T,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.<TKey,TElement>
Enumerable<Grouping<TKey,TElement>>groupBy(Function1<T,TKey> keySelector, Function1<T,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.<TKey,TElement>
Enumerable<Grouping<TKey,TElement>>groupBy(Function1<T,TKey> keySelector, Function1<T,TElement> elementSelector, EqualityComparer<TKey> comparer)
Groups the elements of a sequence according to a key selector function.<TKey,TElement,TResult>
Enumerable<TResult>groupBy(Function1<T,TKey> keySelector, Function1<T,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.<TKey,TElement,TResult>
Enumerable<TResult>groupBy(Function1<T,TKey> keySelector, Function1<T,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.<TKey,TResult>
Enumerable<TResult>groupBy(Function1<T,TKey> keySelector, Function2<TKey,Enumerable<T>,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.<TKey,TResult>
Enumerable<TResult>groupBy(Function1<T,TKey> keySelector, Function2<TKey,Enumerable<T>,TResult> elementSelector, 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.<TInner,TKey,TResult>
Enumerable<TResult>groupJoin(Enumerable<TInner> inner, Function1<T,TKey> outerKeySelector, Function1<TInner,TKey> innerKeySelector, Function2<T,Enumerable<TInner>,TResult> resultSelector)
Correlates the elements of two sequences based on equality of keys and groups the results.<TInner,TKey,TResult>
Enumerable<TResult>groupJoin(Enumerable<TInner> inner, Function1<T,TKey> outerKeySelector, Function1<TInner,TKey> innerKeySelector, Function2<T,Enumerable<TInner>,TResult> resultSelector, EqualityComparer<TKey> comparer)
Correlates the elements of two sequences based on key equality and groups the results.Enumerable<T>
intersect(Enumerable<T> enumerable1)
Produces the set intersection of two sequences by using the default equality comparer to compare values.Enumerable<T>
intersect(Enumerable<T> enumerable1, EqualityComparer<T> comparer)
Produces the set intersection of two sequences by using the specifiedEqualityComparer<TSource>
to compare values.<C extends java.util.Collection<? super T>>
Cinto(C sink)
Copies the contents of this sequence into a collection.<TInner,TKey,TResult>
Enumerable<TResult>join(Enumerable<TInner> inner, Function1<T,TKey> outerKeySelector, Function1<TInner,TKey> innerKeySelector, Function2<T,TInner,TResult> resultSelector)
Correlates the elements of two sequences based on matching keys.<TInner,TKey,TResult>
Enumerable<TResult>join(Enumerable<TInner> inner, Function1<T,TKey> outerKeySelector, Function1<TInner,TKey> innerKeySelector, Function2<T,TInner,TResult> resultSelector, EqualityComparer<TKey> comparer)
Correlates the elements of two sequences based on matching keys.<TInner,TKey,TResult>
Enumerable<TResult>join(Enumerable<TInner> inner, Function1<T,TKey> outerKeySelector, Function1<TInner,TKey> innerKeySelector, Function2<T,TInner,TResult> resultSelector, EqualityComparer<TKey> comparer, boolean generateNullsOnLeft, boolean generateNullsOnRight)
Correlates the elements of two sequences based on matching keys, with optional outer join semantics.T
last()
Returns the last element of a sequence.T
last(Predicate1<T> predicate)
Returns the last element of a sequence that satisfies a specified condition.T
lastOrDefault()
Returns the last element of a sequence, or a default value if the sequence contains no elements.T
lastOrDefault(Predicate1<T> predicate)
Returns the last element of a sequence that satisfies a condition or a default value if no such element is found.long
longCount()
Returns an long that represents the total number of elements in a sequence.long
longCount(Predicate1<T> predicate)
Returns an long that represents how many elements in a sequence satisfy a condition.T
max()
Returns the maximum value in a generic sequence.java.math.BigDecimal
max(BigDecimalFunction1<T> selector)
Invokes a transform function on each element of a sequence and returns the maximum Decimal value.double
max(DoubleFunction1<T> selector)
Invokes a transform function on each element of a sequence and returns the maximum Double value.float
max(FloatFunction1<T> selector)
Invokes a transform function on each element of a sequence and returns the maximum Float value.<TResult extends java.lang.Comparable<TResult>>
TResultmax(Function1<T,TResult> selector)
Invokes a transform function on each element of a generic sequence and returns the maximum resulting value.int
max(IntegerFunction1<T> selector)
Invokes a transform function on each element of a sequence and returns the maximum int value.long
max(LongFunction1<T> selector)
Invokes a transform function on each element of a sequence and returns the maximum long value.java.math.BigDecimal
max(NullableBigDecimalFunction1<T> selector)
Invokes a transform function on each element of a sequence and returns the maximum nullable Decimal value.java.lang.Double
max(NullableDoubleFunction1<T> selector)
Invokes a transform function on each element of a sequence and returns the maximum nullable Double value.java.lang.Float
max(NullableFloatFunction1<T> selector)
Invokes a transform function on each element of a sequence and returns the maximum nullable Float value.java.lang.Integer
max(NullableIntegerFunction1<T> selector)
Invokes a transform function on each element of a sequence and returns the maximum nullable int value.java.lang.Long
max(NullableLongFunction1<T> selector)
Invokes a transform function on each element of a sequence and returns the maximum nullable long value.T
min()
Returns the minimum value in a generic sequence.java.math.BigDecimal
min(BigDecimalFunction1<T> selector)
Invokes a transform function on each element of a sequence and returns the minimum Decimal value.double
min(DoubleFunction1<T> selector)
Invokes a transform function on each element of a sequence and returns the minimum Double value.float
min(FloatFunction1<T> selector)
Invokes a transform function on each element of a sequence and returns the minimum Float value.<TResult extends java.lang.Comparable<TResult>>
TResultmin(Function1<T,TResult> selector)
Invokes a transform function on each element of a generic sequence and returns the minimum resulting value.int
min(IntegerFunction1<T> selector)
Invokes a transform function on each element of a sequence and returns the minimum int value.long
min(LongFunction1<T> selector)
Invokes a transform function on each element of a sequence and returns the minimum long value.java.math.BigDecimal
min(NullableBigDecimalFunction1<T> selector)
Invokes a transform function on each element of a sequence and returns the minimum nullable Decimal value.java.lang.Double
min(NullableDoubleFunction1<T> selector)
Invokes a transform function on each element of a sequence and returns the minimum nullable Double value.java.lang.Float
min(NullableFloatFunction1<T> selector)
Invokes a transform function on each element of a sequence and returns the minimum nullable Float value.java.lang.Integer
min(NullableIntegerFunction1<T> selector)
Invokes a transform function on each element of a sequence and returns the minimum nullable int value.java.lang.Long
min(NullableLongFunction1<T> selector)
Invokes a transform function on each element of a sequence and returns the minimum nullable long value.<TResult> Enumerable<TResult>
ofType(java.lang.Class<TResult> clazz)
Filters the elements of an Enumerable based on a specified type.<TKey extends java.lang.Comparable>
Enumerable<T>orderBy(Function1<T,TKey> keySelector)
Sorts the elements of a sequence in ascending order according to a key.<TKey> Enumerable<T>
orderBy(Function1<T,TKey> keySelector, java.util.Comparator<TKey> comparator)
Sorts the elements of a sequence in ascending order by using a specified comparer.<TKey extends java.lang.Comparable>
Enumerable<T>orderByDescending(Function1<T,TKey> keySelector)
Sorts the elements of a sequence in descending order according to a key.<TKey> Enumerable<T>
orderByDescending(Function1<T,TKey> keySelector, java.util.Comparator<TKey> comparator)
Sorts the elements of a sequence in descending order by using a specified comparer.<C extends java.util.Collection<? super T>>
CremoveAll(C sink)
Removes the contents of this sequence from a collection.Enumerable<T>
reverse()
Inverts the order of the elements in a sequence.<TResult> Enumerable<TResult>
select(Function1<T,TResult> selector)
Projects each element of a sequence into a new form.<TResult> Enumerable<TResult>
select(Function2<T,java.lang.Integer,TResult> selector)
Projects each element of a sequence into a new form by incorporating the element's index.<TCollection,TResult>
Enumerable<TResult>selectMany(Function1<T,Enumerable<TCollection>> collectionSelector, Function2<T,TCollection,TResult> resultSelector)
Projects each element of a sequence to anEnumerable<TSource>
, flattens the resulting sequences into one sequence, and invokes a result selector function on each element therein.<TResult> Enumerable<TResult>
selectMany(Function1<T,Enumerable<TResult>> selector)
Projects each element of a sequence to anEnumerable<TSource>
and flattens the resulting sequences into one sequence.<TCollection,TResult>
Enumerable<TResult>selectMany(Function2<T,java.lang.Integer,Enumerable<TCollection>> collectionSelector, Function2<T,TCollection,TResult> resultSelector)
Projects each element of a sequence to anEnumerable<TSource>
, flattens the resulting sequences into one sequence, and invokes a result selector function on each element therein.<TResult> Enumerable<TResult>
selectMany(Function2<T,java.lang.Integer,Enumerable<TResult>> selector)
Projects each element of a sequence to anEnumerable<TSource>
, and flattens the resulting sequences into one sequence.boolean
sequenceEqual(Enumerable<T> enumerable1)
Determines whether two sequences are equal by comparing the elements by using the default equality comparer for their type.boolean
sequenceEqual(Enumerable<T> enumerable1, EqualityComparer<T> comparer)
Determines whether two sequences are equal by comparing their elements by using a specifiedEqualityComparer<TSource>
.T
single()
Returns the only element of a sequence, and throws an exception if there is not exactly one element in the sequence.T
single(Predicate1<T> predicate)
Returns the only element of a sequence that satisfies a specified condition, and throws an exception if more than one such element exists.T
singleOrDefault()
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.T
singleOrDefault(Predicate1<T> 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.Enumerable<T>
skip(int count)
Bypasses a specified number of elements in a sequence and then returns the remaining elements.Enumerable<T>
skipWhile(Predicate1<T> predicate)
Bypasses elements in a sequence as long as a specified condition is true and then returns the remaining elements.Enumerable<T>
skipWhile(Predicate2<T,java.lang.Integer> predicate)
Bypasses elements in a sequence as long as a specified condition is true and then returns the remaining elements.java.math.BigDecimal
sum(BigDecimalFunction1<T> 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.double
sum(DoubleFunction1<T> 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.float
sum(FloatFunction1<T> 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.int
sum(IntegerFunction1<T> 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.long
sum(LongFunction1<T> 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.java.math.BigDecimal
sum(NullableBigDecimalFunction1<T> 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.java.lang.Double
sum(NullableDoubleFunction1<T> 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.java.lang.Float
sum(NullableFloatFunction1<T> 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.java.lang.Integer
sum(NullableIntegerFunction1<T> 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.java.lang.Long
sum(NullableLongFunction1<T> 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.Enumerable<T>
take(int count)
Returns a specified number of contiguous elements from the start of a sequence.Enumerable<T>
takeWhile(Predicate1<T> predicate)
Returns elements from a sequence as long as a specified condition is true.Enumerable<T>
takeWhile(Predicate2<T,java.lang.Integer> predicate)
Returns elements from a sequence as long as a specified condition is true.<TKey extends java.lang.Comparable<TKey>>
OrderedEnumerable<T>thenBy(Function1<T,TKey> keySelector)
Performs a subsequent ordering of the elements in a sequence in ascending order according to a key.<TKey> OrderedEnumerable<T>
thenBy(Function1<T,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.<TKey extends java.lang.Comparable<TKey>>
OrderedEnumerable<T>thenByDescending(Function1<T,TKey> keySelector)
Performs a subsequent ordering of the elements in a sequence in descending order according to a key.<TKey> OrderedEnumerable<T>
thenByDescending(Function1<T,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.java.util.List<T>
toList()
Creates aList<TSource>
from anEnumerable<TSource>
.<TKey> Lookup<TKey,T>
toLookup(Function1<T,TKey> keySelector)
Creates aLookup<TKey, TElement>
from anEnumerable<TSource>
according to a specified key selector function.<TKey> Lookup<TKey,T>
toLookup(Function1<T,TKey> keySelector, EqualityComparer<TKey> comparer)
Creates aLookup<TKey, TElement>
from anEnumerable<TSource>
according to a specified key selector function and key comparer.<TKey,TElement>
Lookup<TKey,TElement>toLookup(Function1<T,TKey> keySelector, Function1<T,TElement> elementSelector)
Creates aLookup<TKey, TElement>
from anEnumerable<TSource>
according to specified key selector and element selector functions.<TKey,TElement>
Lookup<TKey,TElement>toLookup(Function1<T,TKey> keySelector, Function1<T,TElement> elementSelector, EqualityComparer<TKey> comparer)
Creates aLookup<TKey, TElement>
from anEnumerable<TSource>
according to a specified key selector function, a comparer and an element selector function.<TKey> java.util.Map<TKey,T>
toMap(Function1<T,TKey> keySelector)
Creates aMap<TKey, TValue>
from anEnumerable<TSource>
according to a specified key selector function.<TKey> java.util.Map<TKey,T>
toMap(Function1<T,TKey> keySelector, EqualityComparer<TKey> comparer)
Creates aMap<TKey, TValue>
from anEnumerable<TSource>
according to a specified key selector function and key comparer.<TKey,TElement>
java.util.Map<TKey,TElement>toMap(Function1<T,TKey> keySelector, Function1<T,TElement> elementSelector)
Creates aMap<TKey, TValue>
from anEnumerable<TSource>
according to specified key selector and element selector functions.<TKey,TElement>
java.util.Map<TKey,TElement>toMap(Function1<T,TKey> keySelector, Function1<T,TElement> elementSelector, EqualityComparer<TKey> comparer)
Creates aMap<TKey, TValue>
from anEnumerable<TSource>
according to a specified key selector function, a comparer, and an element selector function.Enumerable<T>
union(Enumerable<T> source1)
Produces the set union of two sequences by using the default equality comparer.Enumerable<T>
union(Enumerable<T> source1, EqualityComparer<T> comparer)
Produces the set union of two sequences by using a specifiedEqualityComparer<TSource>
.Enumerable<T>
where(Predicate1<T> predicate)
Filters a sequence of values based on a predicate.Enumerable<T>
where(Predicate2<T,java.lang.Integer> predicate)
Filters a sequence of values based on a predicate.<T1,TResult>
Enumerable<TResult>zip(Enumerable<T1> source1, Function2<T,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
-
Methods inherited from interface org.apache.calcite.linq4j.RawEnumerable
enumerator
-
-
-
-
Method Detail
-
getThis
protected Enumerable<T> getThis()
Derived classes might wish to override this method to return the "outer" enumerable.
-
getThisOrdered
protected OrderedEnumerable<T> getThisOrdered()
Derived classes might wish to override this method to return the "outer" ordered-enumerable.
-
foreach
public <R> R foreach(Function1<T,R> func)
Description copied from interface:ExtendedEnumerable
Performs an operation for each member of this enumeration.Returns the value returned by the function for the last element in this enumeration, or null if this enumeration is empty.
- Specified by:
foreach
in interfaceExtendedEnumerable<T>
- Type Parameters:
R
- Return type- Parameters:
func
- Operation
-
asQueryable
public Queryable<T> asQueryable()
Description copied from interface:Enumerable
Converts this Enumerable to a Queryable.- Specified by:
asQueryable
in interfaceEnumerable<T>
- Specified by:
asQueryable
in interfaceExtendedEnumerable<T>
- Returns:
- A queryable
- See Also:
EnumerableDefaults.asQueryable(Enumerable)
-
asOrderedQueryable
protected OrderedQueryable<T> asOrderedQueryable()
-
aggregate
public T aggregate(Function2<T,T,T> func)
Description copied from interface:ExtendedEnumerable
Applies an accumulator function over a sequence.- Specified by:
aggregate
in interfaceExtendedEnumerable<T>
-
aggregate
public <TAccumulate> TAccumulate aggregate(TAccumulate seed, Function2<TAccumulate,T,TAccumulate> func)
Description copied from interface:ExtendedEnumerable
Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value.- Specified by:
aggregate
in interfaceExtendedEnumerable<T>
-
aggregate
public <TAccumulate,TResult> TResult aggregate(TAccumulate seed, Function2<TAccumulate,T,TAccumulate> func, Function1<TAccumulate,TResult> selector)
Description copied from interface:ExtendedEnumerable
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.- Specified by:
aggregate
in interfaceExtendedEnumerable<T>
-
all
public boolean all(Predicate1<T> predicate)
Description copied from interface:ExtendedEnumerable
Determines whether all elements of a sequence satisfy a condition.- Specified by:
all
in interfaceExtendedEnumerable<T>
-
any
public boolean any()
Description copied from interface:ExtendedEnumerable
Determines whether a sequence contains any elements. (Defined by Enumerable.)- Specified by:
any
in interfaceExtendedEnumerable<T>
-
any
public boolean any(Predicate1<T> predicate)
Description copied from interface:ExtendedEnumerable
Determines whether any element of a sequence satisfies a condition.- Specified by:
any
in interfaceExtendedEnumerable<T>
-
asEnumerable
public Enumerable<T> asEnumerable()
Description copied from interface:ExtendedEnumerable
Returns the input typed asEnumerable<TSource>
.This method has no effect other than to change the compile-time type of source from a type that implements
Enumerable<TSource>
toEnumerable<TSource>
itself.asEnumerable<TSource>(Enumerable<TSource>)
can be used to choose between query implementations when a sequence implementsEnumerable<TSource>
but also has a different set of public query methods available. For example, given a generic class Table that implementsEnumerable<TSource>
and has its own methods such aswhere
,select
, andselectMany
, a call towhere
would invoke the publicwhere
method ofTable
. ATable
type that represents a database table could have awhere
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, theasEnumerable<TSource>
method can be used to hide the custom methods and instead make the standard query operators available.- Specified by:
asEnumerable
in interfaceExtendedEnumerable<T>
-
average
public java.math.BigDecimal average(BigDecimalFunction1<T> selector)
Description copied from interface:ExtendedEnumerable
Computes the average of a sequence of Decimal values that are obtained by invoking a transform function on each element of the input sequence.- Specified by:
average
in interfaceExtendedEnumerable<T>
-
average
public java.math.BigDecimal average(NullableBigDecimalFunction1<T> selector)
Description copied from interface:ExtendedEnumerable
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.- Specified by:
average
in interfaceExtendedEnumerable<T>
-
average
public double average(DoubleFunction1<T> selector)
Description copied from interface:ExtendedEnumerable
Computes the average of a sequence of Double values that are obtained by invoking a transform function on each element of the input sequence.- Specified by:
average
in interfaceExtendedEnumerable<T>
-
average
public java.lang.Double average(NullableDoubleFunction1<T> selector)
Description copied from interface:ExtendedEnumerable
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.- Specified by:
average
in interfaceExtendedEnumerable<T>
-
average
public int average(IntegerFunction1<T> selector)
Description copied from interface:ExtendedEnumerable
Computes the average of a sequence of int values that are obtained by invoking a transform function on each element of the input sequence.- Specified by:
average
in interfaceExtendedEnumerable<T>
-
average
public java.lang.Integer average(NullableIntegerFunction1<T> selector)
Description copied from interface:ExtendedEnumerable
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.- Specified by:
average
in interfaceExtendedEnumerable<T>
-
average
public long average(LongFunction1<T> selector)
Description copied from interface:ExtendedEnumerable
Computes the average of a sequence of long values that are obtained by invoking a transform function on each element of the input sequence.- Specified by:
average
in interfaceExtendedEnumerable<T>
-
average
public java.lang.Long average(NullableLongFunction1<T> selector)
Description copied from interface:ExtendedEnumerable
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.- Specified by:
average
in interfaceExtendedEnumerable<T>
-
average
public float average(FloatFunction1<T> selector)
Description copied from interface:ExtendedEnumerable
Computes the average of a sequence of Float values that are obtained by invoking a transform function on each element of the input sequence.- Specified by:
average
in interfaceExtendedEnumerable<T>
-
average
public java.lang.Float average(NullableFloatFunction1<T> selector)
Description copied from interface:ExtendedEnumerable
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.- Specified by:
average
in interfaceExtendedEnumerable<T>
-
cast
public <T2> Enumerable<T2> cast(java.lang.Class<T2> clazz)
Description copied from interface:ExtendedEnumerable
Converts the elements of this Enumerable to the specified type.This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its
RawEnumerable.enumerator()
method directly or by usingfor (... in ...)
.If an element cannot be cast to type TResult, the
Enumerator.current()
method will throw aClassCastException
a exception when the element it accessed. To obtain only those elements that can be cast to type TResult, use theExtendedEnumerable.ofType(Class)
method instead.- Specified by:
cast
in interfaceExtendedEnumerable<T>
- See Also:
EnumerableDefaults.cast(org.apache.calcite.linq4j.Enumerable<TSource>, java.lang.Class<T2>)
,ExtendedEnumerable.ofType(Class)
-
concat
public Enumerable<T> concat(Enumerable<T> enumerable1)
Description copied from interface:ExtendedEnumerable
Concatenates two sequences.- Specified by:
concat
in interfaceExtendedEnumerable<T>
-
contains
public boolean contains(T element)
Description copied from interface:ExtendedEnumerable
Determines whether a sequence contains a specified element by using the default equality comparer.- Specified by:
contains
in interfaceExtendedEnumerable<T>
-
contains
public boolean contains(T element, EqualityComparer<T> comparer)
Description copied from interface:ExtendedEnumerable
Determines whether a sequence contains a specified element by using a specifiedEqualityComparer<TSource>
.- Specified by:
contains
in interfaceExtendedEnumerable<T>
-
count
public int count()
Description copied from interface:ExtendedEnumerable
Returns the number of elements in a sequence.- Specified by:
count
in interfaceExtendedEnumerable<T>
-
count
public int count(Predicate1<T> predicate)
Description copied from interface:ExtendedEnumerable
Returns a number that represents how many elements in the specified sequence satisfy a condition.- Specified by:
count
in interfaceExtendedEnumerable<T>
-
createOrderedEnumerable
public <TKey> OrderedEnumerable<T> createOrderedEnumerable(Function1<T,TKey> keySelector, java.util.Comparator<TKey> comparator, boolean descending)
Description copied from interface:ExtendedOrderedEnumerable
Performs a subsequent ordering of the elements in anOrderedEnumerable
according to a key, using a specified comparator.The functionality provided by this method is like that provided by
thenBy
orthenByDescending
, depending on whether descending is true or false. They both perform a subordinate ordering of an already sorted sequence of typeOrderedEnumerable
.- Specified by:
createOrderedEnumerable
in interfaceExtendedOrderedEnumerable<T>
-
defaultIfEmpty
public Enumerable<T> defaultIfEmpty()
Description copied from interface:ExtendedEnumerable
Returns the elements of the specified sequence or the type parameter's default value in a singleton collection if the sequence is empty.- Specified by:
defaultIfEmpty
in interfaceExtendedEnumerable<T>
-
defaultIfEmpty
public Enumerable<T> defaultIfEmpty(T value)
Description copied from interface:ExtendedEnumerable
Returns the elements of the specified sequence or the specified value in a singleton collection if the sequence is empty.- Specified by:
defaultIfEmpty
in interfaceExtendedEnumerable<T>
-
distinct
public Enumerable<T> distinct()
Description copied from interface:ExtendedEnumerable
Returns distinct elements from a sequence by using the default equality comparer to compare values.- Specified by:
distinct
in interfaceExtendedEnumerable<T>
-
distinct
public Enumerable<T> distinct(EqualityComparer<T> comparer)
Description copied from interface:ExtendedEnumerable
Returns distinct elements from a sequence by using a specifiedEqualityComparer<TSource>
to compare values.- Specified by:
distinct
in interfaceExtendedEnumerable<T>
-
elementAt
public T elementAt(int index)
Description copied from interface:ExtendedEnumerable
Returns the element at a specified index in a sequence.- Specified by:
elementAt
in interfaceExtendedEnumerable<T>
-
elementAtOrDefault
public T elementAtOrDefault(int index)
Description copied from interface:ExtendedEnumerable
Returns the element at a specified index in a sequence or a default value if the index is out of range.- Specified by:
elementAtOrDefault
in interfaceExtendedEnumerable<T>
-
except
public Enumerable<T> except(Enumerable<T> enumerable1)
Description copied from interface:ExtendedEnumerable
Produces the set difference of two sequences by using the default equality comparer to compare values. (Defined by Enumerable.)- Specified by:
except
in interfaceExtendedEnumerable<T>
-
except
public Enumerable<T> except(Enumerable<T> enumerable1, EqualityComparer<T> comparer)
Description copied from interface:ExtendedEnumerable
Produces the set difference of two sequences by using the specifiedEqualityComparer<TSource>
to compare values.- Specified by:
except
in interfaceExtendedEnumerable<T>
-
first
public T first()
Description copied from interface:ExtendedEnumerable
Returns the first element of a sequence. (Defined by Enumerable.)- Specified by:
first
in interfaceExtendedEnumerable<T>
-
first
public T first(Predicate1<T> predicate)
Description copied from interface:ExtendedEnumerable
Returns the first element in a sequence that satisfies a specified condition.- Specified by:
first
in interfaceExtendedEnumerable<T>
-
firstOrDefault
public T firstOrDefault()
Description copied from interface:ExtendedEnumerable
Returns the first element of a sequence, or a default value if the sequence contains no elements.- Specified by:
firstOrDefault
in interfaceExtendedEnumerable<T>
-
firstOrDefault
public T firstOrDefault(Predicate1<T> predicate)
Description copied from interface:ExtendedEnumerable
Returns the first element of the sequence that satisfies a condition or a default value if no such element is found.- Specified by:
firstOrDefault
in interfaceExtendedEnumerable<T>
-
groupBy
public <TKey> Enumerable<Grouping<TKey,T>> groupBy(Function1<T,TKey> keySelector)
Description copied from interface:ExtendedEnumerable
Groups the elements of a sequence according to a specified key selector function.- Specified by:
groupBy
in interfaceExtendedEnumerable<T>
-
groupBy
public <TKey> Enumerable<Grouping<TKey,T>> groupBy(Function1<T,TKey> keySelector, EqualityComparer<TKey> comparer)
Description copied from interface:ExtendedEnumerable
Groups the elements of a sequence according to a specified key selector function and compares the keys by using a specified comparer.- Specified by:
groupBy
in interfaceExtendedEnumerable<T>
-
groupBy
public <TKey,TElement> Enumerable<Grouping<TKey,TElement>> groupBy(Function1<T,TKey> keySelector, Function1<T,TElement> elementSelector)
Description copied from interface:ExtendedEnumerable
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.- Specified by:
groupBy
in interfaceExtendedEnumerable<T>
-
groupBy
public <TKey,TElement> Enumerable<Grouping<TKey,TElement>> groupBy(Function1<T,TKey> keySelector, Function1<T,TElement> elementSelector, EqualityComparer<TKey> comparer)
Description copied from interface:ExtendedEnumerable
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.- Specified by:
groupBy
in interfaceExtendedEnumerable<T>
-
groupBy
public <TKey,TResult> Enumerable<TResult> groupBy(Function1<T,TKey> keySelector, Function2<TKey,Enumerable<T>,TResult> elementSelector, EqualityComparer<TKey> comparer)
Description copied from interface:ExtendedEnumerable
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.- Specified by:
groupBy
in interfaceExtendedEnumerable<T>
-
groupBy
public <TKey,TResult> Enumerable<TResult> groupBy(Function1<T,TKey> keySelector, Function2<TKey,Enumerable<T>,TResult> resultSelector)
Description copied from interface:ExtendedEnumerable
Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key.- Specified by:
groupBy
in interfaceExtendedEnumerable<T>
-
groupBy
public <TKey,TElement,TResult> Enumerable<TResult> groupBy(Function1<T,TKey> keySelector, Function1<T,TElement> elementSelector, Function2<TKey,Enumerable<TElement>,TResult> resultSelector)
Description copied from interface:ExtendedEnumerable
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.- Specified by:
groupBy
in interfaceExtendedEnumerable<T>
-
groupBy
public <TKey,TElement,TResult> Enumerable<TResult> groupBy(Function1<T,TKey> keySelector, Function1<T,TElement> elementSelector, Function2<TKey,Enumerable<TElement>,TResult> resultSelector, EqualityComparer<TKey> comparer)
Description copied from interface:ExtendedEnumerable
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.- Specified by:
groupBy
in interfaceExtendedEnumerable<T>
-
groupBy
public <TKey,TAccumulate,TResult> Enumerable<TResult> groupBy(Function1<T,TKey> keySelector, Function0<TAccumulate> accumulatorInitializer, Function2<TAccumulate,T,TAccumulate> accumulatorAdder, Function2<TKey,TAccumulate,TResult> resultSelector)
Description copied from interface:ExtendedEnumerable
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.- Specified by:
groupBy
in interfaceExtendedEnumerable<T>
-
groupBy
public <TKey,TAccumulate,TResult> Enumerable<TResult> groupBy(Function1<T,TKey> keySelector, Function0<TAccumulate> accumulatorInitializer, Function2<TAccumulate,T,TAccumulate> accumulatorAdder, Function2<TKey,TAccumulate,TResult> resultSelector, EqualityComparer<TKey> comparer)
Description copied from interface:ExtendedEnumerable
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.- Specified by:
groupBy
in interfaceExtendedEnumerable<T>
-
groupJoin
public <TInner,TKey,TResult> Enumerable<TResult> groupJoin(Enumerable<TInner> inner, Function1<T,TKey> outerKeySelector, Function1<TInner,TKey> innerKeySelector, Function2<T,Enumerable<TInner>,TResult> resultSelector)
Description copied from interface:ExtendedEnumerable
Correlates the elements of two sequences based on equality of keys and groups the results. The default equality comparer is used to compare keys.- Specified by:
groupJoin
in interfaceExtendedEnumerable<T>
-
groupJoin
public <TInner,TKey,TResult> Enumerable<TResult> groupJoin(Enumerable<TInner> inner, Function1<T,TKey> outerKeySelector, Function1<TInner,TKey> innerKeySelector, Function2<T,Enumerable<TInner>,TResult> resultSelector, EqualityComparer<TKey> comparer)
Description copied from interface:ExtendedEnumerable
Correlates the elements of two sequences based on key equality and groups the results. A specifiedEqualityComparer<TSource>
is used to compare keys.- Specified by:
groupJoin
in interfaceExtendedEnumerable<T>
-
intersect
public Enumerable<T> intersect(Enumerable<T> enumerable1)
Description copied from interface:ExtendedEnumerable
Produces the set intersection of two sequences by using the default equality comparer to compare values. (Defined by Enumerable.)- Specified by:
intersect
in interfaceExtendedEnumerable<T>
-
intersect
public Enumerable<T> intersect(Enumerable<T> enumerable1, EqualityComparer<T> comparer)
Description copied from interface:ExtendedEnumerable
Produces the set intersection of two sequences by using the specifiedEqualityComparer<TSource>
to compare values.- Specified by:
intersect
in interfaceExtendedEnumerable<T>
-
into
public <C extends java.util.Collection<? super T>> C into(C sink)
Description copied from interface:ExtendedEnumerable
Copies the contents of this sequence into a collection.- Specified by:
into
in interfaceExtendedEnumerable<T>
-
removeAll
public <C extends java.util.Collection<? super T>> C removeAll(C sink)
Description copied from interface:ExtendedEnumerable
Removes the contents of this sequence from a collection.- Specified by:
removeAll
in interfaceExtendedEnumerable<T>
-
join
public <TInner,TKey,TResult> Enumerable<TResult> join(Enumerable<TInner> inner, Function1<T,TKey> outerKeySelector, Function1<TInner,TKey> innerKeySelector, Function2<T,TInner,TResult> resultSelector)
Description copied from interface:ExtendedEnumerable
Correlates the elements of two sequences based on matching keys. The default equality comparer is used to compare keys.- Specified by:
join
in interfaceExtendedEnumerable<T>
-
join
public <TInner,TKey,TResult> Enumerable<TResult> join(Enumerable<TInner> inner, Function1<T,TKey> outerKeySelector, Function1<TInner,TKey> innerKeySelector, Function2<T,TInner,TResult> resultSelector, EqualityComparer<TKey> comparer)
Description copied from interface:ExtendedEnumerable
Correlates the elements of two sequences based on matching keys. A specifiedEqualityComparer<TSource>
is used to compare keys.- Specified by:
join
in interfaceExtendedEnumerable<T>
-
join
public <TInner,TKey,TResult> Enumerable<TResult> join(Enumerable<TInner> inner, Function1<T,TKey> outerKeySelector, Function1<TInner,TKey> innerKeySelector, Function2<T,TInner,TResult> resultSelector, EqualityComparer<TKey> comparer, boolean generateNullsOnLeft, boolean generateNullsOnRight)
Description copied from interface:ExtendedEnumerable
Correlates the elements of two sequences based on matching keys, with optional outer join semantics. A specifiedEqualityComparer<TSource>
is used to compare keys.A left join generates nulls on right, and vice versa:
Join types Join type generateNullsOnLeft generateNullsOnRight INNER false false LEFT false true RIGHT true false FULL true true - Specified by:
join
in interfaceExtendedEnumerable<T>
-
correlateJoin
public <TInner,TResult> Enumerable<TResult> correlateJoin(CorrelateJoinType joinType, Function1<T,Enumerable<TInner>> inner, Function2<T,TInner,TResult> resultSelector)
Description copied from interface:ExtendedEnumerable
For each row of the current enumerable returns the correlated rows from theinner
enumerable (nested loops join).- Specified by:
correlateJoin
in interfaceExtendedEnumerable<T>
- Parameters:
joinType
- inner, left, semi or anti join typeinner
- generator of inner enumerableresultSelector
- selector of the result. For semi/anti join inner argument is always null.
-
last
public T last()
Description copied from interface:ExtendedEnumerable
Returns the last element of a sequence. (Defined by Enumerable.)- Specified by:
last
in interfaceExtendedEnumerable<T>
-
last
public T last(Predicate1<T> predicate)
Description copied from interface:ExtendedEnumerable
Returns the last element of a sequence that satisfies a specified condition.- Specified by:
last
in interfaceExtendedEnumerable<T>
-
lastOrDefault
public T lastOrDefault()
Description copied from interface:ExtendedEnumerable
Returns the last element of a sequence, or a default value if the sequence contains no elements.- Specified by:
lastOrDefault
in interfaceExtendedEnumerable<T>
-
lastOrDefault
public T lastOrDefault(Predicate1<T> predicate)
Description copied from interface:ExtendedEnumerable
Returns the last element of a sequence that satisfies a condition or a default value if no such element is found.- Specified by:
lastOrDefault
in interfaceExtendedEnumerable<T>
-
longCount
public long longCount()
Description copied from interface:ExtendedEnumerable
Returns an long that represents the total number of elements in a sequence.- Specified by:
longCount
in interfaceExtendedEnumerable<T>
-
longCount
public long longCount(Predicate1<T> predicate)
Description copied from interface:ExtendedEnumerable
Returns an long that represents how many elements in a sequence satisfy a condition.- Specified by:
longCount
in interfaceExtendedEnumerable<T>
-
max
public T max()
Description copied from interface:ExtendedEnumerable
Returns the maximum value in a generic sequence.- Specified by:
max
in interfaceExtendedEnumerable<T>
-
max
public java.math.BigDecimal max(BigDecimalFunction1<T> selector)
Description copied from interface:ExtendedEnumerable
Invokes a transform function on each element of a sequence and returns the maximum Decimal value.- Specified by:
max
in interfaceExtendedEnumerable<T>
-
max
public java.math.BigDecimal max(NullableBigDecimalFunction1<T> selector)
Description copied from interface:ExtendedEnumerable
Invokes a transform function on each element of a sequence and returns the maximum nullable Decimal value.- Specified by:
max
in interfaceExtendedEnumerable<T>
-
max
public double max(DoubleFunction1<T> selector)
Description copied from interface:ExtendedEnumerable
Invokes a transform function on each element of a sequence and returns the maximum Double value.- Specified by:
max
in interfaceExtendedEnumerable<T>
-
max
public java.lang.Double max(NullableDoubleFunction1<T> selector)
Description copied from interface:ExtendedEnumerable
Invokes a transform function on each element of a sequence and returns the maximum nullable Double value.- Specified by:
max
in interfaceExtendedEnumerable<T>
-
max
public int max(IntegerFunction1<T> selector)
Description copied from interface:ExtendedEnumerable
Invokes a transform function on each element of a sequence and returns the maximum int value.- Specified by:
max
in interfaceExtendedEnumerable<T>
-
max
public java.lang.Integer max(NullableIntegerFunction1<T> selector)
Description copied from interface:ExtendedEnumerable
Invokes a transform function on each element of a sequence and returns the maximum nullable int value. (Defined by Enumerable.)- Specified by:
max
in interfaceExtendedEnumerable<T>
-
max
public long max(LongFunction1<T> selector)
Description copied from interface:ExtendedEnumerable
Invokes a transform function on each element of a sequence and returns the maximum long value.- Specified by:
max
in interfaceExtendedEnumerable<T>
-
max
public java.lang.Long max(NullableLongFunction1<T> selector)
Description copied from interface:ExtendedEnumerable
Invokes a transform function on each element of a sequence and returns the maximum nullable long value. (Defined by Enumerable.)- Specified by:
max
in interfaceExtendedEnumerable<T>
-
max
public float max(FloatFunction1<T> selector)
Description copied from interface:ExtendedEnumerable
Invokes a transform function on each element of a sequence and returns the maximum Float value.- Specified by:
max
in interfaceExtendedEnumerable<T>
-
max
public java.lang.Float max(NullableFloatFunction1<T> selector)
Description copied from interface:ExtendedEnumerable
Invokes a transform function on each element of a sequence and returns the maximum nullable Float value.- Specified by:
max
in interfaceExtendedEnumerable<T>
-
max
public <TResult extends java.lang.Comparable<TResult>> TResult max(Function1<T,TResult> selector)
Description copied from interface:ExtendedEnumerable
Invokes a transform function on each element of a generic sequence and returns the maximum resulting value.- Specified by:
max
in interfaceExtendedEnumerable<T>
-
min
public T min()
Description copied from interface:ExtendedEnumerable
Returns the minimum value in a generic sequence.- Specified by:
min
in interfaceExtendedEnumerable<T>
-
min
public java.math.BigDecimal min(BigDecimalFunction1<T> selector)
Description copied from interface:ExtendedEnumerable
Invokes a transform function on each element of a sequence and returns the minimum Decimal value.- Specified by:
min
in interfaceExtendedEnumerable<T>
-
min
public java.math.BigDecimal min(NullableBigDecimalFunction1<T> selector)
Description copied from interface:ExtendedEnumerable
Invokes a transform function on each element of a sequence and returns the minimum nullable Decimal value.- Specified by:
min
in interfaceExtendedEnumerable<T>
-
min
public double min(DoubleFunction1<T> selector)
Description copied from interface:ExtendedEnumerable
Invokes a transform function on each element of a sequence and returns the minimum Double value.- Specified by:
min
in interfaceExtendedEnumerable<T>
-
min
public java.lang.Double min(NullableDoubleFunction1<T> selector)
Description copied from interface:ExtendedEnumerable
Invokes a transform function on each element of a sequence and returns the minimum nullable Double value.- Specified by:
min
in interfaceExtendedEnumerable<T>
-
min
public int min(IntegerFunction1<T> selector)
Description copied from interface:ExtendedEnumerable
Invokes a transform function on each element of a sequence and returns the minimum int value.- Specified by:
min
in interfaceExtendedEnumerable<T>
-
min
public java.lang.Integer min(NullableIntegerFunction1<T> selector)
Description copied from interface:ExtendedEnumerable
Invokes a transform function on each element of a sequence and returns the minimum nullable int value. (Defined by Enumerable.)- Specified by:
min
in interfaceExtendedEnumerable<T>
-
min
public long min(LongFunction1<T> selector)
Description copied from interface:ExtendedEnumerable
Invokes a transform function on each element of a sequence and returns the minimum long value.- Specified by:
min
in interfaceExtendedEnumerable<T>
-
min
public java.lang.Long min(NullableLongFunction1<T> selector)
Description copied from interface:ExtendedEnumerable
Invokes a transform function on each element of a sequence and returns the minimum nullable long value. (Defined by Enumerable.)- Specified by:
min
in interfaceExtendedEnumerable<T>
-
min
public float min(FloatFunction1<T> selector)
Description copied from interface:ExtendedEnumerable
Invokes a transform function on each element of a sequence and returns the minimum Float value.- Specified by:
min
in interfaceExtendedEnumerable<T>
-
min
public java.lang.Float min(NullableFloatFunction1<T> selector)
Description copied from interface:ExtendedEnumerable
Invokes a transform function on each element of a sequence and returns the minimum nullable Float value.- Specified by:
min
in interfaceExtendedEnumerable<T>
-
min
public <TResult extends java.lang.Comparable<TResult>> TResult min(Function1<T,TResult> selector)
Description copied from interface:ExtendedEnumerable
Invokes a transform function on each element of a generic sequence and returns the minimum resulting value.- Specified by:
min
in interfaceExtendedEnumerable<T>
-
ofType
public <TResult> Enumerable<TResult> ofType(java.lang.Class<TResult> clazz)
Description copied from interface:ExtendedEnumerable
Filters the elements of an Enumerable based on a specified type.Analogous to LINQ's Enumerable.OfType extension method.
- Specified by:
ofType
in interfaceExtendedEnumerable<T>
- Type Parameters:
TResult
- Target type- Parameters:
clazz
- Target type- Returns:
- Collection of T2
-
orderBy
public <TKey extends java.lang.Comparable> Enumerable<T> orderBy(Function1<T,TKey> keySelector)
Description copied from interface:ExtendedEnumerable
Sorts the elements of a sequence in ascending order according to a key.- Specified by:
orderBy
in interfaceExtendedEnumerable<T>
-
orderBy
public <TKey> Enumerable<T> orderBy(Function1<T,TKey> keySelector, java.util.Comparator<TKey> comparator)
Description copied from interface:ExtendedEnumerable
Sorts the elements of a sequence in ascending order by using a specified comparer.- Specified by:
orderBy
in interfaceExtendedEnumerable<T>
-
orderByDescending
public <TKey extends java.lang.Comparable> Enumerable<T> orderByDescending(Function1<T,TKey> keySelector)
Description copied from interface:ExtendedEnumerable
Sorts the elements of a sequence in descending order according to a key.- Specified by:
orderByDescending
in interfaceExtendedEnumerable<T>
-
orderByDescending
public <TKey> Enumerable<T> orderByDescending(Function1<T,TKey> keySelector, java.util.Comparator<TKey> comparator)
Description copied from interface:ExtendedEnumerable
Sorts the elements of a sequence in descending order by using a specified comparer.- Specified by:
orderByDescending
in interfaceExtendedEnumerable<T>
-
reverse
public Enumerable<T> reverse()
Description copied from interface:ExtendedEnumerable
Inverts the order of the elements in a sequence.- Specified by:
reverse
in interfaceExtendedEnumerable<T>
-
select
public <TResult> Enumerable<TResult> select(Function1<T,TResult> selector)
Description copied from interface:ExtendedEnumerable
Projects each element of a sequence into a new form.- Specified by:
select
in interfaceExtendedEnumerable<T>
-
select
public <TResult> Enumerable<TResult> select(Function2<T,java.lang.Integer,TResult> selector)
Description copied from interface:ExtendedEnumerable
Projects each element of a sequence into a new form by incorporating the element's index.- Specified by:
select
in interfaceExtendedEnumerable<T>
-
selectMany
public <TResult> Enumerable<TResult> selectMany(Function1<T,Enumerable<TResult>> selector)
Description copied from interface:ExtendedEnumerable
Projects each element of a sequence to anEnumerable<TSource>
and flattens the resulting sequences into one sequence.- Specified by:
selectMany
in interfaceExtendedEnumerable<T>
-
selectMany
public <TResult> Enumerable<TResult> selectMany(Function2<T,java.lang.Integer,Enumerable<TResult>> selector)
Description copied from interface:ExtendedEnumerable
Projects each element of a sequence to anEnumerable<TSource>
, and flattens the resulting sequences into one sequence. The index of each source element is used in the projected form of that element.- Specified by:
selectMany
in interfaceExtendedEnumerable<T>
-
selectMany
public <TCollection,TResult> Enumerable<TResult> selectMany(Function2<T,java.lang.Integer,Enumerable<TCollection>> collectionSelector, Function2<T,TCollection,TResult> resultSelector)
Description copied from interface:ExtendedEnumerable
Projects each element of a sequence to anEnumerable<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.- Specified by:
selectMany
in interfaceExtendedEnumerable<T>
-
selectMany
public <TCollection,TResult> Enumerable<TResult> selectMany(Function1<T,Enumerable<TCollection>> collectionSelector, Function2<T,TCollection,TResult> resultSelector)
Description copied from interface:ExtendedEnumerable
Projects each element of a sequence to anEnumerable<TSource>
, flattens the resulting sequences into one sequence, and invokes a result selector function on each element therein.- Specified by:
selectMany
in interfaceExtendedEnumerable<T>
-
sequenceEqual
public boolean sequenceEqual(Enumerable<T> enumerable1)
Description copied from interface:ExtendedEnumerable
Determines whether two sequences are equal by comparing the elements by using the default equality comparer for their type.- Specified by:
sequenceEqual
in interfaceExtendedEnumerable<T>
-
sequenceEqual
public boolean sequenceEqual(Enumerable<T> enumerable1, EqualityComparer<T> comparer)
Description copied from interface:ExtendedEnumerable
Determines whether two sequences are equal by comparing their elements by using a specifiedEqualityComparer<TSource>
.- Specified by:
sequenceEqual
in interfaceExtendedEnumerable<T>
-
single
public T single()
Description copied from interface:ExtendedEnumerable
Returns the only element of a sequence, and throws an exception if there is not exactly one element in the sequence.- Specified by:
single
in interfaceExtendedEnumerable<T>
-
single
public T single(Predicate1<T> predicate)
Description copied from interface:ExtendedEnumerable
Returns the only element of a sequence that satisfies a specified condition, and throws an exception if more than one such element exists.- Specified by:
single
in interfaceExtendedEnumerable<T>
-
singleOrDefault
public T singleOrDefault()
Description copied from interface:ExtendedEnumerable
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.- Specified by:
singleOrDefault
in interfaceExtendedEnumerable<T>
-
singleOrDefault
public T singleOrDefault(Predicate1<T> predicate)
Description copied from interface:ExtendedEnumerable
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.- Specified by:
singleOrDefault
in interfaceExtendedEnumerable<T>
-
skip
public Enumerable<T> skip(int count)
Description copied from interface:ExtendedEnumerable
Bypasses a specified number of elements in a sequence and then returns the remaining elements.- Specified by:
skip
in interfaceExtendedEnumerable<T>
-
skipWhile
public Enumerable<T> skipWhile(Predicate1<T> predicate)
Description copied from interface:ExtendedEnumerable
Bypasses elements in a sequence as long as a specified condition is true and then returns the remaining elements.- Specified by:
skipWhile
in interfaceExtendedEnumerable<T>
-
skipWhile
public Enumerable<T> skipWhile(Predicate2<T,java.lang.Integer> predicate)
Description copied from interface:ExtendedEnumerable
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.- Specified by:
skipWhile
in interfaceExtendedEnumerable<T>
-
sum
public java.math.BigDecimal sum(BigDecimalFunction1<T> selector)
Description copied from interface:ExtendedEnumerable
Computes the sum of the sequence of Decimal values that are obtained by invoking a transform function on each element of the input sequence.- Specified by:
sum
in interfaceExtendedEnumerable<T>
-
sum
public java.math.BigDecimal sum(NullableBigDecimalFunction1<T> selector)
Description copied from interface:ExtendedEnumerable
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.- Specified by:
sum
in interfaceExtendedEnumerable<T>
-
sum
public double sum(DoubleFunction1<T> selector)
Description copied from interface:ExtendedEnumerable
Computes the sum of the sequence of Double values that are obtained by invoking a transform function on each element of the input sequence.- Specified by:
sum
in interfaceExtendedEnumerable<T>
-
sum
public java.lang.Double sum(NullableDoubleFunction1<T> selector)
Description copied from interface:ExtendedEnumerable
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.- Specified by:
sum
in interfaceExtendedEnumerable<T>
-
sum
public int sum(IntegerFunction1<T> selector)
Description copied from interface:ExtendedEnumerable
Computes the sum of the sequence of int values that are obtained by invoking a transform function on each element of the input sequence.- Specified by:
sum
in interfaceExtendedEnumerable<T>
-
sum
public java.lang.Integer sum(NullableIntegerFunction1<T> selector)
Description copied from interface:ExtendedEnumerable
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.- Specified by:
sum
in interfaceExtendedEnumerable<T>
-
sum
public long sum(LongFunction1<T> selector)
Description copied from interface:ExtendedEnumerable
Computes the sum of the sequence of long values that are obtained by invoking a transform function on each element of the input sequence.- Specified by:
sum
in interfaceExtendedEnumerable<T>
-
sum
public java.lang.Long sum(NullableLongFunction1<T> selector)
Description copied from interface:ExtendedEnumerable
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.- Specified by:
sum
in interfaceExtendedEnumerable<T>
-
sum
public float sum(FloatFunction1<T> selector)
Description copied from interface:ExtendedEnumerable
Computes the sum of the sequence of Float values that are obtained by invoking a transform function on each element of the input sequence.- Specified by:
sum
in interfaceExtendedEnumerable<T>
-
sum
public java.lang.Float sum(NullableFloatFunction1<T> selector)
Description copied from interface:ExtendedEnumerable
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.- Specified by:
sum
in interfaceExtendedEnumerable<T>
-
take
public Enumerable<T> take(int count)
Description copied from interface:ExtendedEnumerable
Returns a specified number of contiguous elements from the start of a sequence.- Specified by:
take
in interfaceExtendedEnumerable<T>
-
takeWhile
public Enumerable<T> takeWhile(Predicate1<T> predicate)
Description copied from interface:ExtendedEnumerable
Returns elements from a sequence as long as a specified condition is true.- Specified by:
takeWhile
in interfaceExtendedEnumerable<T>
-
takeWhile
public Enumerable<T> takeWhile(Predicate2<T,java.lang.Integer> predicate)
Description copied from interface:ExtendedEnumerable
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.- Specified by:
takeWhile
in interfaceExtendedEnumerable<T>
-
thenBy
public <TKey extends java.lang.Comparable<TKey>> OrderedEnumerable<T> thenBy(Function1<T,TKey> keySelector)
Description copied from interface:ExtendedOrderedEnumerable
Performs a subsequent ordering of the elements in a sequence in ascending order according to a key.- Specified by:
thenBy
in interfaceExtendedOrderedEnumerable<T>
-
thenBy
public <TKey> OrderedEnumerable<T> thenBy(Function1<T,TKey> keySelector, java.util.Comparator<TKey> comparator)
Description copied from interface:ExtendedOrderedEnumerable
Performs a subsequent ordering of the elements in a sequence in ascending order according to a key, using a specified comparator.- Specified by:
thenBy
in interfaceExtendedOrderedEnumerable<T>
-
thenByDescending
public <TKey extends java.lang.Comparable<TKey>> OrderedEnumerable<T> thenByDescending(Function1<T,TKey> keySelector)
Description copied from interface:ExtendedOrderedEnumerable
Performs a subsequent ordering of the elements in a sequence in descending order according to a key.- Specified by:
thenByDescending
in interfaceExtendedOrderedEnumerable<T>
-
thenByDescending
public <TKey> OrderedEnumerable<T> thenByDescending(Function1<T,TKey> keySelector, java.util.Comparator<TKey> comparator)
Description copied from interface:ExtendedOrderedEnumerable
Performs a subsequent ordering of the elements in a sequence in descending order according to a key, using a specified comparator.- Specified by:
thenByDescending
in interfaceExtendedOrderedEnumerable<T>
-
toMap
public <TKey> java.util.Map<TKey,T> toMap(Function1<T,TKey> keySelector)
Description copied from interface:ExtendedEnumerable
Creates aMap<TKey, TValue>
from anEnumerable<TSource>
according to a specified key selector function.NOTE: Called
toDictionary
in LINQ.NET.- Specified by:
toMap
in interfaceExtendedEnumerable<T>
-
toMap
public <TKey> java.util.Map<TKey,T> toMap(Function1<T,TKey> keySelector, EqualityComparer<TKey> comparer)
Description copied from interface:ExtendedEnumerable
Creates aMap<TKey, TValue>
from anEnumerable<TSource>
according to a specified key selector function and key comparer.- Specified by:
toMap
in interfaceExtendedEnumerable<T>
-
toMap
public <TKey,TElement> java.util.Map<TKey,TElement> toMap(Function1<T,TKey> keySelector, Function1<T,TElement> elementSelector)
Description copied from interface:ExtendedEnumerable
Creates aMap<TKey, TValue>
from anEnumerable<TSource>
according to specified key selector and element selector functions.- Specified by:
toMap
in interfaceExtendedEnumerable<T>
-
toMap
public <TKey,TElement> java.util.Map<TKey,TElement> toMap(Function1<T,TKey> keySelector, Function1<T,TElement> elementSelector, EqualityComparer<TKey> comparer)
Description copied from interface:ExtendedEnumerable
Creates aMap<TKey, TValue>
from anEnumerable<TSource>
according to a specified key selector function, a comparer, and an element selector function.- Specified by:
toMap
in interfaceExtendedEnumerable<T>
-
toList
public java.util.List<T> toList()
Description copied from interface:ExtendedEnumerable
Creates aList<TSource>
from anEnumerable<TSource>
.- Specified by:
toList
in interfaceExtendedEnumerable<T>
-
toLookup
public <TKey> Lookup<TKey,T> toLookup(Function1<T,TKey> keySelector)
Description copied from interface:ExtendedEnumerable
Creates aLookup<TKey, TElement>
from anEnumerable<TSource>
according to a specified key selector function.- Specified by:
toLookup
in interfaceExtendedEnumerable<T>
-
toLookup
public <TKey> Lookup<TKey,T> toLookup(Function1<T,TKey> keySelector, EqualityComparer<TKey> comparer)
Description copied from interface:ExtendedEnumerable
Creates aLookup<TKey, TElement>
from anEnumerable<TSource>
according to a specified key selector function and key comparer.- Specified by:
toLookup
in interfaceExtendedEnumerable<T>
-
toLookup
public <TKey,TElement> Lookup<TKey,TElement> toLookup(Function1<T,TKey> keySelector, Function1<T,TElement> elementSelector)
Description copied from interface:ExtendedEnumerable
Creates aLookup<TKey, TElement>
from anEnumerable<TSource>
according to specified key selector and element selector functions.- Specified by:
toLookup
in interfaceExtendedEnumerable<T>
-
toLookup
public <TKey,TElement> Lookup<TKey,TElement> toLookup(Function1<T,TKey> keySelector, Function1<T,TElement> elementSelector, EqualityComparer<TKey> comparer)
Description copied from interface:ExtendedEnumerable
Creates aLookup<TKey, TElement>
from anEnumerable<TSource>
according to a specified key selector function, a comparer and an element selector function.- Specified by:
toLookup
in interfaceExtendedEnumerable<T>
-
union
public Enumerable<T> union(Enumerable<T> source1)
Description copied from interface:ExtendedEnumerable
Produces the set union of two sequences by using the default equality comparer.- Specified by:
union
in interfaceExtendedEnumerable<T>
-
union
public Enumerable<T> union(Enumerable<T> source1, EqualityComparer<T> comparer)
Description copied from interface:ExtendedEnumerable
Produces the set union of two sequences by using a specifiedEqualityComparer<TSource>
.- Specified by:
union
in interfaceExtendedEnumerable<T>
-
where
public Enumerable<T> where(Predicate1<T> predicate)
Description copied from interface:ExtendedEnumerable
Filters a sequence of values based on a predicate.- Specified by:
where
in interfaceExtendedEnumerable<T>
-
where
public Enumerable<T> where(Predicate2<T,java.lang.Integer> predicate)
Description copied from interface:ExtendedEnumerable
Filters a sequence of values based on a predicate. Each element's index is used in the logic of the predicate function.- Specified by:
where
in interfaceExtendedEnumerable<T>
-
zip
public <T1,TResult> Enumerable<TResult> zip(Enumerable<T1> source1, Function2<T,T1,TResult> resultSelector)
Description copied from interface:ExtendedEnumerable
Applies a specified function to the corresponding elements of two sequences, producing a sequence of the results.- Specified by:
zip
in interfaceExtendedEnumerable<T>
-
-