Package | Description |
---|---|
net.hydromatic.linq4j |
Language-integrated query for Java (linq4j) main package.
|
net.hydromatic.linq4j.function |
Contains definitions of functions and predicates.
|
Modifier and Type | Method and Description |
---|---|
static <TSource> boolean |
EnumerableDefaults.all(Enumerable<?> enumerable,
Predicate1<TSource> predicate)
Determines whether all elements of a sequence
satisfy a condition.
|
boolean |
DefaultEnumerable.all(Predicate1<T> predicate) |
boolean |
ExtendedEnumerable.all(Predicate1<TSource> predicate)
Determines whether all elements of a sequence
satisfy a condition.
|
static <TSource> boolean |
EnumerableDefaults.any(Enumerable<TSource> enumerable,
Predicate1<TSource> predicate)
Determines whether any element of a sequence
satisfies a condition.
|
boolean |
DefaultEnumerable.any(Predicate1<T> predicate) |
boolean |
ExtendedEnumerable.any(Predicate1<TSource> predicate)
Determines whether any element of a sequence
satisfies a condition.
|
static <TSource> int |
EnumerableDefaults.count(Enumerable<TSource> enumerable,
Predicate1<TSource> predicate)
Returns a number that represents how many elements
in the specified sequence satisfy a condition.
|
int |
DefaultEnumerable.count(Predicate1<T> predicate) |
int |
ExtendedEnumerable.count(Predicate1<TSource> predicate)
Returns a number that represents how many elements
in the specified sequence satisfy a condition.
|
static <TSource> TSource |
EnumerableDefaults.first(Enumerable<TSource> enumerable,
Predicate1<TSource> predicate)
Returns the first element in a sequence that
satisfies a specified condition.
|
T |
DefaultEnumerable.first(Predicate1<T> predicate) |
TSource |
ExtendedEnumerable.first(Predicate1<TSource> predicate)
Returns the first element in a sequence that
satisfies a specified condition.
|
static <TSource> TSource |
EnumerableDefaults.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.
|
T |
DefaultEnumerable.firstOrDefault(Predicate1<T> predicate) |
TSource |
ExtendedEnumerable.firstOrDefault(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> TSource |
EnumerableDefaults.last(Enumerable<TSource> enumerable,
Predicate1<TSource> predicate)
Returns the last element of a sequence that
satisfies a specified condition.
|
T |
DefaultEnumerable.last(Predicate1<T> predicate) |
TSource |
ExtendedEnumerable.last(Predicate1<TSource> predicate)
Returns the last element of a sequence that
satisfies a specified condition.
|
static <TSource> TSource |
EnumerableDefaults.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.
|
T |
DefaultEnumerable.lastOrDefault(Predicate1<T> predicate) |
TSource |
ExtendedEnumerable.lastOrDefault(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 |
EnumerableDefaults.longCount(Enumerable<TSource> enumerable,
Predicate1<TSource> predicate)
Returns an long that represents how many elements
in a sequence satisfy a condition.
|
long |
DefaultEnumerable.longCount(Predicate1<T> predicate) |
long |
ExtendedEnumerable.longCount(Predicate1<TSource> predicate)
Returns an long that represents how many elements
in a sequence satisfy a condition.
|
static <TSource> TSource |
EnumerableDefaults.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.
|
T |
DefaultEnumerable.single(Predicate1<T> predicate) |
TSource |
ExtendedEnumerable.single(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 |
EnumerableDefaults.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.
|
T |
DefaultEnumerable.singleOrDefault(Predicate1<T> predicate) |
TSource |
ExtendedEnumerable.singleOrDefault(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> |
EnumerableDefaults.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.
|
Enumerable<T> |
DefaultEnumerable.skipWhile(Predicate1<T> predicate) |
Enumerable<TSource> |
ExtendedEnumerable.skipWhile(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> |
EnumerableDefaults.takeWhile(Enumerable<TSource> source,
Predicate1<TSource> predicate)
Returns elements from a sequence as long as a
specified condition is true.
|
Enumerable<T> |
DefaultEnumerable.takeWhile(Predicate1<T> predicate) |
Enumerable<TSource> |
ExtendedEnumerable.takeWhile(Predicate1<TSource> predicate)
Returns elements from a sequence as long as a
specified condition is true.
|
static <TSource> Enumerable<TSource> |
EnumerableDefaults.where(Enumerable<TSource> source,
Predicate1<TSource> predicate)
Filters a sequence of values based on a
predicate.
|
Enumerable<T> |
DefaultEnumerable.where(Predicate1<T> predicate) |
Enumerable<TSource> |
ExtendedEnumerable.where(Predicate1<TSource> predicate)
Filters a sequence of values based on a
predicate.
|
Modifier and Type | Method and Description |
---|---|
boolean |
QueryableFactory.all(Queryable<T> source,
FunctionExpression<Predicate1<T>> predicate)
Determines whether all the elements of a sequence
satisfy a condition.
|
boolean |
QueryableRecorder.all(Queryable<T> source,
FunctionExpression<Predicate1<T>> predicate) |
static <T> boolean |
QueryableDefaults.all(Queryable<T> queryable,
FunctionExpression<Predicate1<T>> predicate)
Determines whether all the elements of a sequence
satisfy a condition.
|
boolean |
QueryableFactory.any(Queryable<T> source,
FunctionExpression<Predicate1<T>> predicate)
Determines whether any element of a sequence
satisfies a condition.
|
boolean |
QueryableRecorder.any(Queryable<T> source,
FunctionExpression<Predicate1<T>> predicate) |
static <T> boolean |
QueryableDefaults.any(Queryable<T> queryable,
FunctionExpression<Predicate1<T>> predicate)
Determines whether any element of a sequence
satisfies a condition.
|
int |
QueryableFactory.count(Queryable<T> source,
FunctionExpression<Predicate1<T>> predicate)
Returns the number of elements in the specified
sequence that satisfies a condition.
|
int |
QueryableRecorder.count(Queryable<T> source,
FunctionExpression<Predicate1<T>> func) |
static <T> int |
QueryableDefaults.count(Queryable<T> queryable,
FunctionExpression<Predicate1<T>> func)
Returns the number of elements in the specified
sequence that satisfies a condition.
|
T |
QueryableFactory.first(Queryable<T> source,
FunctionExpression<Predicate1<T>> predicate)
Returns the first element of a sequence that
satisfies a specified condition.
|
T |
QueryableRecorder.first(Queryable<T> source,
FunctionExpression<Predicate1<T>> predicate) |
static <T> T |
QueryableDefaults.first(Queryable<T> queryable,
FunctionExpression<Predicate1<T>> predicate)
Returns the first element of a sequence that
satisfies a specified condition.
|
T |
QueryableFactory.firstOrDefault(Queryable<T> source,
FunctionExpression<Predicate1<T>> predicate)
Returns the first element of a sequence that
satisfies a specified condition or a default value if no such
element is found.
|
T |
QueryableRecorder.firstOrDefault(Queryable<T> source,
FunctionExpression<Predicate1<T>> predicate) |
static <T> T |
QueryableDefaults.firstOrDefault(Queryable<T> queryable,
FunctionExpression<Predicate1<T>> predicate)
Returns the first element of a sequence that
satisfies a specified condition or a default value if no such
element is found.
|
T |
QueryableFactory.last(Queryable<T> source,
FunctionExpression<Predicate1<T>> predicate)
Returns the last element of a sequence that
satisfies a specified condition.
|
T |
QueryableRecorder.last(Queryable<T> source,
FunctionExpression<Predicate1<T>> predicate) |
static <T> T |
QueryableDefaults.last(Queryable<T> queryable,
FunctionExpression<Predicate1<T>> predicate)
Returns the last element of a sequence that
satisfies a specified condition.
|
T |
QueryableFactory.lastOrDefault(Queryable<T> source,
FunctionExpression<Predicate1<T>> predicate)
Returns the last element of a sequence that
satisfies a condition or a default value if no such element is
found.
|
T |
QueryableRecorder.lastOrDefault(Queryable<T> source,
FunctionExpression<Predicate1<T>> predicate) |
static <T> T |
QueryableDefaults.lastOrDefault(Queryable<T> queryable,
FunctionExpression<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 |
QueryableFactory.longCount(Queryable<T> source,
FunctionExpression<Predicate1<T>> predicate)
Returns an long that represents the number of
elements in a sequence that satisfy a condition.
|
long |
QueryableRecorder.longCount(Queryable<T> source,
FunctionExpression<Predicate1<T>> predicate) |
static <T> long |
QueryableDefaults.longCount(Queryable<T> queryable,
FunctionExpression<Predicate1<T>> predicate)
Returns an long that represents the number of
elements in a sequence that satisfy a condition.
|
T |
QueryableFactory.single(Queryable<T> source,
FunctionExpression<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 |
QueryableRecorder.single(Queryable<T> source,
FunctionExpression<Predicate1<T>> predicate) |
static <T> T |
QueryableDefaults.single(Queryable<T> source,
FunctionExpression<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 |
QueryableFactory.singleOrDefault(Queryable<T> source,
FunctionExpression<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.
|
T |
QueryableRecorder.singleOrDefault(Queryable<T> source,
FunctionExpression<Predicate1<T>> predicate) |
static <T> T |
QueryableDefaults.singleOrDefault(Queryable<T> source,
FunctionExpression<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.
|
Queryable<T> |
QueryableFactory.skipWhile(Queryable<T> source,
FunctionExpression<Predicate1<T>> predicate)
Bypasses elements in a sequence as long as a
specified condition is true and then returns the remaining
elements.
|
Queryable<T> |
QueryableRecorder.skipWhile(Queryable<T> source,
FunctionExpression<Predicate1<T>> predicate) |
static <T> Queryable<T> |
QueryableDefaults.skipWhile(Queryable<T> source,
FunctionExpression<Predicate1<T>> predicate)
Bypasses elements in a sequence as long as a
specified condition is true and then returns the remaining
elements.
|
Queryable<T> |
QueryableFactory.takeWhile(Queryable<T> source,
FunctionExpression<Predicate1<T>> predicate)
Returns elements from a sequence as long as a
specified condition is true.
|
Queryable<T> |
QueryableRecorder.takeWhile(Queryable<T> source,
FunctionExpression<Predicate1<T>> predicate) |
static <T> Queryable<T> |
QueryableDefaults.takeWhile(Queryable<T> source,
FunctionExpression<Predicate1<T>> predicate)
Returns elements from a sequence as long as a
specified condition is true.
|
Queryable<T> |
QueryableFactory.where(Queryable<T> source,
FunctionExpression<? extends Predicate1<T>> predicate)
Filters a sequence of values based on a
predicate.
|
Queryable<T> |
QueryableRecorder.where(Queryable<T> source,
FunctionExpression<? extends Predicate1<T>> predicate) |
static <T> Queryable<T> |
QueryableDefaults.where(Queryable<T> source,
FunctionExpression<Predicate1<T>> predicate)
Filters a sequence of values based on a
predicate.
|
Modifier and Type | Field and Description |
---|---|
static Predicate1<Object> |
Predicate1.FALSE
Predicate that always evaluates to
false . |
static Predicate1<Object> |
Predicate1.TRUE
Predicate that always evaluates to
true . |
Modifier and Type | Method and Description |
---|---|
static <T> Predicate1<T> |
Functions.falsePredicate1()
A predicate with one parameter that always returns
true . |
static <T,T2> Predicate1<T> |
Functions.ofTypePredicate(Class<T2> clazz)
Creates a predicate that returns whether an object is an instance of a
particular type or is null.
|
static <T> Predicate1<T> |
Functions.truePredicate1()
A predicate with one parameter that always returns
true . |
Modifier and Type | Method and Description |
---|---|
static <E> boolean |
Functions.all(List<? extends E> list,
Predicate1<E> predicate)
Returns whether
predicate is true for all elements of
list . |
static <E> boolean |
Functions.exists(List<? extends E> list,
Predicate1<E> predicate)
Returns whether there is an element in
list for which
predicate is true. |
static <E> List<E> |
Functions.filter(List<E> list,
Predicate1<E> predicate)
Returns a list that contains only elements of
list that match
predicate . |
static <T1,T2> Predicate2<T1,T2> |
Functions.toPredicate2(Predicate1<T1> p1) |
Copyright © 2012-2014 Julian Hyde. All Rights Reserved.