Skip to content

Integer Query Operations

Malcolm Groves edited this page Jan 14, 2014 · 1 revision

FluentQuery supports the following operations when querying Integers from a container (eg, a TList<Integer>):

Operation Bound Unbound Terminating Description
Average Yes Yes Returns a Double containing the average (mean) of all items that match the query.
Equals Yes Yes Enumerates integers that match the supplied value.
First Yes Yes Enumerate the first integer, ignoring the remainder.
From Yes From allows you to specify the source of the data you are querying. It is also From which transforms an Unbound Query into a Bound Query.
GreaterThan Yes Yes Enumerates integers that are greater than the supplied value.
GreaterThanOrEquals Yes Yes Enumerates integers that are greater than or equal to the supplied value.
LessThan Yes Yes Enumerates integers that are less than the supplied value.
LessThanOrEquals Yes Yes Enumerates integers that are less than or equal to the supplied value.
Max Yes Yes Returns an Integer containing the largest of the items that match the query.
Min Yes Yes Returns an Integer containing the smallest of the items that match the query.
NonZero Yes Yes Enumerates integers that are not equal to zero.
NotEquals Yes Yes Enumerates integers that do not match the supplied value.
Predicate Yes Yes Returns a TPredicate<Integer> encapsulating the supplied Unbound Query logic.
Skip Yes Yes Skip will bypass the specified number of integers from the start of the enumeration, after which it will enumerate the remaining integers as normal.
SkipWhile(Predicate) Yes Yes SkipWhile will bypass integers at the start of the enumeration while the supplied Predicate evaluates True. Once the Predicate evaluates false, all remaining integers will be enumerated as normal.
SkipWhile(UnboundQuery) Yes Yes SkipWhile will bypass integers at the start of the enumeration that match the supplied Unbound Query. Once an integer does not match the supplied query, all remaining integers will be enumerated as normal.
Sum Yes Yes Returns an Integer containing the sum of all items that match the query.
Take Yes Yes Take will enumerate up to the specified number of integers, then ignore the remainder.
TakeWhile(Predicate) Yes Yes TakeWhile will continue enumerating integers while the supplied Predicate evaluates True, after which it will ignore the remaining items.
TakeWhile(UnboundQuery) Yes Yes TakeWhile will continue enumerating integers while they match the supplied Unbound Query, after which it will ignore the remaining items.
ToTList Yes Yes Returns a TList<Integer> containing the integers that match the query
Where(Predicate) Yes Yes Filter the integers enumerated to only those that evaluate true when passed into the supplied Predicate
WhereNot(Predicate) Yes Yes Filter the integers enumerated to only those that evaluate false when passed into the supplied Predicate
WhereNot(UnboundQuery) Yes Yes Filter the integers enumerated to only those that do not match the supplied Unbound Query
Zero Yes Yes Enumerates integers that are equal to zero.