Package org.geotools.feature.visitor
Enum Class Aggregate
- All Implemented Interfaces:
Serializable
,Comparable<Aggregate>
,Constable
Aggregate functions defined for use with the GeoTools library.
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionabstract FeatureCalc
create
(Expression expression) Factory method creating a visitor using an aggregate attribute.abstract Class
getTargetType
(Class inputType) Retruns the type of the result, given the type of the input.static Aggregate
Returns the enum constant of this class 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 class, in the order they are declared.abstract CalcResult
wrap
(Expression expression, Object value) Wraps a raw value in the appropriate visitor calculation result.
-
Enum Constant Details
-
AVERAGE
-
COUNT
-
MAX
-
MEDIAN
-
MIN
-
STD_DEV
-
SUM
-
SUMAREA
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException
- if the argument is null
-
create
Factory method creating a visitor using an aggregate attribute.- Parameters:
expression
- Expression used to sample collection (often a PropertyName)- Returns:
- a new instance of the visitor
-
wrap
Wraps a raw value in the appropriate visitor calculation result. The typical usage of this is to wrap values returned by stores able to handle the visitor (for example the JDBCDataStore).- Parameters:
expression
- Expression used to sample collection (often a PropertyName)value
- The raw value to be wrapped- Returns:
- value Wrapped in the appropriate visitor calculation result
-
getTargetType
Retruns the type of the result, given the type of the input. Will throw an exception if the input type is not acceptable- Returns:
-
valueOfIgnoreCase
Helper method that given a visitor name returns the appropriate enum constant.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).
- Parameters:
visitorName
- the visitor name- Returns:
- this enum constant that machs the visitor name
-