public class GroupingFunctions extends AbstractFunctionHandler
Modifier and Type | Field and Description |
---|---|
static String |
HANDLER_ID |
static String |
VALUE |
q
Constructor and Description |
---|
GroupingFunctions() |
Modifier and Type | Method and Description |
---|---|
Double |
avg(Expression exp) |
Double |
avg(List allobjs,
Expression exp) |
Double |
avg(List allobjs,
Expression exp,
String saveValueName) |
void |
checkType(Object o,
Class expected,
Expression exp) |
String |
concat(Expression exp) |
String |
concat(List allobjs,
Expression exp) |
String |
concat(List allobjs,
Expression exp,
String sep) |
String |
concat(List allobjs,
Expression exp,
String sep,
String saveValueName) |
Object |
greatest(List allobjs,
Expression exp) |
Object |
greatest(List allobjs,
Expression exp,
String saveValueName) |
Object |
greatestObject(List allobjs,
Expression exp) |
Object |
least(List allobjs,
Expression exp) |
Object |
least(List allobjs,
Expression exp,
String saveValueName) |
Object |
leastObject(List allobjs,
Expression exp) |
Object |
max(Expression exp) |
Object |
max(List allobjs,
Expression exp) |
Object |
max(List allobjs,
Expression exp,
String saveValueName) |
Map.Entry |
maxEntry(Map m,
String type) |
Object |
maxObject(Expression exp) |
Object |
maxObject(List allobjs,
Expression exp) |
Object |
min(Expression exp) |
Object |
min(List allobjs,
Expression exp) |
Object |
min(List allobjs,
Expression exp,
String saveValueName) |
Map.Entry |
minEntry(Map m,
String type) |
Map.Entry |
minEntry(Object m,
String type) |
Object |
minObject(Expression exp) |
Object |
minObject(List allobjs,
Expression exp) |
Map |
occurrence(List objs)
A function that will take each item from the passed in List and
determine a "count" for each item, i.e.
|
Map |
occurrence(List objs,
Expression exp)
A function that will take each item from the passed in List and
determine a "count" for each item, i.e.
|
Map |
occurrence(List objs,
Expression exp,
Expression limitExp)
This is the same as
occurrence(List,Expression) except that the
second expression should evaluate to a number that will be used to limit the
results, the occurrence count must be greater than or equal to the value from
the expression. |
Double |
sum(Expression exp) |
Double |
sum(List objs,
Expression exp) |
Double |
sum(List allobjs,
Expression exp,
String saveValueName) |
Double |
sum(List objs,
String acc)
This function allows you to specify your own accessor as a string that will
be used to access the relevant value for each of the objects in the objs
List.
|
setQuery
public static final String VALUE
public static final String HANDLER_ID
public Object least(List allobjs, Expression exp, String saveValueName) throws QueryExecutionException
QueryExecutionException
public Object minObject(Expression exp) throws QueryExecutionException
QueryExecutionException
public Object minObject(List allobjs, Expression exp) throws QueryExecutionException
QueryExecutionException
public Object leastObject(List allobjs, Expression exp) throws QueryExecutionException
QueryExecutionException
public Object maxObject(List allobjs, Expression exp) throws QueryExecutionException
QueryExecutionException
public Object maxObject(Expression exp) throws QueryExecutionException
QueryExecutionException
public Object greatestObject(List allobjs, Expression exp) throws QueryExecutionException
QueryExecutionException
public Object least(List allobjs, Expression exp) throws QueryExecutionException
QueryExecutionException
public Object min(Expression exp) throws QueryExecutionException
QueryExecutionException
public Object min(List allobjs, Expression exp) throws QueryExecutionException
QueryExecutionException
public Object min(List allobjs, Expression exp, String saveValueName) throws QueryExecutionException
QueryExecutionException
public Map.Entry minEntry(Object m, String type) throws QueryExecutionException
QueryExecutionException
public Object max(List allobjs, Expression exp, String saveValueName) throws QueryExecutionException
QueryExecutionException
public Object greatest(List allobjs, Expression exp, String saveValueName) throws QueryExecutionException
QueryExecutionException
public Object greatest(List allobjs, Expression exp) throws QueryExecutionException
QueryExecutionException
public Object max(Expression exp) throws QueryExecutionException
QueryExecutionException
public Object max(List allobjs, Expression exp) throws QueryExecutionException
QueryExecutionException
public void checkType(Object o, Class expected, Expression exp) throws QueryExecutionException
QueryExecutionException
public Double sum(List allobjs, Expression exp, String saveValueName) throws QueryExecutionException
QueryExecutionException
public Double sum(Expression exp) throws QueryExecutionException
QueryExecutionException
public Double sum(List objs, Expression exp) throws QueryExecutionException
QueryExecutionException
public Double sum(List objs, String acc) throws QueryExecutionException
objs
- The List of objects you wish to sum over.acc
- The accessor to create for accessing the value in each of the objects in objs.QueryExecutionException
- If the accessor is not valid for the objects in the list or
if the accessor throws an exception.public String concat(List allobjs, Expression exp, String sep, String saveValueName) throws QueryExecutionException
QueryExecutionException
public String concat(List allobjs, Expression exp, String sep) throws QueryExecutionException
QueryExecutionException
public String concat(Expression exp) throws QueryExecutionException
QueryExecutionException
public String concat(List allobjs, Expression exp) throws QueryExecutionException
QueryExecutionException
public Double avg(List allobjs, Expression exp, String saveValueName) throws QueryExecutionException
QueryExecutionException
public Double avg(Expression exp) throws QueryExecutionException
QueryExecutionException
public Double avg(List allobjs, Expression exp) throws QueryExecutionException
QueryExecutionException
public Map occurrence(List objs) throws QueryExecutionException
objs
- The List of objects to operate on.QueryExecutionException
- Won't happen in this method.public Map occurrence(List objs, Expression exp) throws QueryExecutionException
objs
- The List of objects to operate on.exp
- An optional expression that should be performed on each object
and the value returned used instead.QueryExecutionException
- If the expression cannot be evaluated.public Map occurrence(List objs, Expression exp, Expression limitExp) throws QueryExecutionException
occurrence(List,Expression)
except that the
second expression should evaluate to a number that will be used to limit the
results, the occurrence count must be greater than or equal to the value from
the expression.objs
- The List of objects to operate on.exp
- An optional expression that should be performed on each object
and the value returned used instead.limitExp
- An expression that when evaluated should return a number, this
will then be used to limit the results returned to those that have an
occurrence count >= that number.QueryExecutionException
- If the expression cannot be evaluated or the limitExp
arg does not evaulate to a number.