public enum Aggregate extends Enum<Aggregate>
Aggregates are backed by a FeatureCalc
visitor for direct use with a FeatureCollection
(or use with GroupByVisitor
). THe create(Expression)
method is used as a
factory method to configure an appropriate visitor.
During processing a CalcResult
is used to store intermediate results. Implementations
that handle an aggregate function directly (such as JDBCDataStore) can use can use the wrap
method to generate the expect CalcResult from a calculated raw value.
Enum Constant and Description |
---|
AVERAGE |
COUNT |
MAX |
MEDIAN |
MIN |
STD_DEV |
SUM |
SUMAREA |
Modifier and Type | Method and Description |
---|---|
abstract FeatureCalc |
create(Expression expression)
Factory method creating a visitor using an aggregate attribute.
|
static Aggregate |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Aggregate |
valueOfIgnoreCase(String visitorName)
Helper method that given a visitor name returns the appropriate enum constant.
|
static Aggregate[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
abstract CalcResult |
wrap(Expression expression,
Object value)
Wraps a raw value in the appropriate visitor calculation result.
|
public static final Aggregate AVERAGE
public static final Aggregate COUNT
public static final Aggregate MAX
public static final Aggregate MEDIAN
public static final Aggregate MIN
public static final Aggregate STD_DEV
public static final Aggregate SUM
public static final Aggregate SUMAREA
public static Aggregate[] values()
for (Aggregate c : Aggregate.values()) System.out.println(c);
public static Aggregate valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic abstract FeatureCalc create(Expression expression)
expression
- Expression used to sample collection (often a PropertyName)public abstract CalcResult wrap(Expression expression, Object value)
expression
- Expression used to sample collection (often a PropertyName)value
- The raw value to be wrappedpublic static Aggregate valueOfIgnoreCase(String visitorName)
The performed match by name is more permissive that the default one. The match will not be case sensitive and slightly different names can be used (camel case versus snake case).
visitorName
- the visitor nameCopyright © 1996–2019 Geotools. All rights reserved.