org.eobjects.metamodel.query
Enum FunctionType
java.lang.Object
java.lang.Enum<FunctionType>
org.eobjects.metamodel.query.FunctionType
- All Implemented Interfaces:
- Serializable, Comparable<FunctionType>
public enum FunctionType
- extends Enum<FunctionType>
Represents an aggregate function to use in a SelectItem.
- See Also:
SelectItem
COUNT
public static final FunctionType COUNT
AVG
public static final FunctionType AVG
SUM
public static final FunctionType SUM
MAX
public static final FunctionType MAX
MIN
public static final FunctionType MIN
values
public static FunctionType[] values()
- Returns an array containing the constants of this enum type, in
the order they are declared. This method may be used to iterate
over the constants as follows:
for (FunctionType c : FunctionType.values())
System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in
the order they are declared
valueOf
public static FunctionType valueOf(String name)
- Returns the enum constant of this type with the specified name.
The string must match exactly an identifier used to declare an
enum constant in this type. (Extraneous whitespace characters are
not permitted.)
- Parameters:
name - the name of the enum constant to be returned.
- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException - if this enum type has no constant
with the specified name
NullPointerException - if the argument is null
getExpectedColumnType
public ColumnType getExpectedColumnType(ColumnType type)
createSelectItem
public SelectItem createSelectItem(Column column)
createSelectItem
public SelectItem createSelectItem(String expression,
String alias)
evaluate
public Object evaluate(Iterable<?> values)
evaluate
public Object evaluate(Object... values)
- Executes the function
- Parameters:
values - the values to be evaluated. If a value is null it won't be
evaluated
- Returns:
- the result of the function execution. The return type class is
dependent on the FunctionType and the values provided. COUNT
yields a Long, AVG and SUM yields Double values and MAX and MIN
yields the type of the provided values.
build
public abstract AggregateBuilder<?> build()
get
public static FunctionType get(String functionName)
Copyright © 2007-2013. All Rights Reserved.