Package org.geotools.feature.visitor
Enum Aggregate
- 
- All Implemented Interfaces:
- Serializable,- Comparable<Aggregate>
 
 public enum Aggregate extends Enum<Aggregate> Aggregate functions defined for use with the GeoTools library.Aggregates are backed by a FeatureCalcvisitor for direct use with a FeatureCollection (or use withGroupByVisitor). THecreate(Expression)method is used as a factory method to configure an appropriate visitor.During processing a CalcResultis 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.
- 
- 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract FeatureCalccreate(Expression expression)Factory method creating a visitor using an aggregate attribute.abstract ClassgetTargetType(Class inputType)Retruns the type of the result, given the type of the input.static AggregatevalueOf(String name)Returns the enum constant of this type with the specified name.static AggregatevalueOfIgnoreCase(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 CalcResultwrap(Expression expression, Object value)Wraps a raw value in the appropriate visitor calculation result.
 
- 
- 
- 
Enum Constant Detail- 
AVERAGEpublic static final Aggregate AVERAGE 
 - 
COUNTpublic static final Aggregate COUNT 
 - 
MAXpublic static final Aggregate MAX 
 - 
MEDIANpublic static final Aggregate MEDIAN 
 - 
MINpublic static final Aggregate MIN 
 - 
STD_DEVpublic static final Aggregate STD_DEV 
 - 
SUMpublic static final Aggregate SUM 
 - 
SUMAREApublic static final Aggregate SUMAREA 
 
- 
 - 
Method Detail- 
valuespublic static Aggregate[] 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 (Aggregate c : Aggregate.values()) System.out.println(c); - Returns:
- an array containing the constants of this enum type, in the order they are declared
 
 - 
valueOfpublic static Aggregate 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
 
 - 
createpublic abstract FeatureCalc create(Expression expression) 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
 
 - 
wrappublic abstract CalcResult wrap(Expression expression, Object value) 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
 
 - 
getTargetTypepublic abstract Class getTargetType(Class inputType) Retruns the type of the result, given the type of the input. Will throw an exception if the input type is not acceptable- Returns:
 
 - 
valueOfIgnoreCasepublic static Aggregate valueOfIgnoreCase(String visitorName) 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
 
 
- 
 
-