Package org.geotools.feature.visitor
Class GroupByVisitor
Object
GroupByVisitor
- All Implemented Interfaces:
- FeatureVisitor,- FeatureAttributeVisitor,- FeatureCalc
Group features by one or several attributes and applies an aggregator visitor to each group.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classHelper class that should be used by optimizations to set the results.static classThis class implements the feature calculation result of the group by visitor.
- 
Constructor SummaryConstructorsConstructorDescriptionGroupByVisitor(Aggregate aggregateVisitor, Expression expression, List<Expression> groupByAttributes, ProgressListener progressListener) 
- 
Method SummaryModifier and TypeMethodDescriptionReturns the aggregate visitor used by this group by visitor.List of expressions used by visitor.This method computes and returns the group by visitor result.getResultType(List<Class> inputTypes) Returns the expected output type given the input type.voidMethods that allow optimizations to directly set the group by visitor result instead of computing it visiting all the features.voidVisit the provided feature.booleanboolean
- 
Constructor Details- 
GroupByVisitorpublic GroupByVisitor(Aggregate aggregateVisitor, Expression expression, List<Expression> groupByAttributes, ProgressListener progressListener) 
 
- 
- 
Method Details- 
wasOptimizedpublic boolean wasOptimized()
- 
wasVisitedpublic boolean wasVisited()
- 
getAggregateReturns the aggregate visitor used by this group by visitor. This is the visitor that will be applied to each group of features.
- 
getResultThis method computes and returns the group by visitor result. If the computation was optimized the optimization result is returned otherwise the result is computed in memory. If for some reason an optimization result exists and there are visited features, an in memory computation is performed and is merged with the existing optimization results.- Specified by:
- getResultin interface- FeatureCalc
- Returns:
- group by visitor result
 
- 
visitDescription copied from interface:FeatureVisitorVisit the provided feature.Please consult the documentation for the FeatureCollection you are visiting to learn more - the provided feature may be invalid, or read only. - Specified by:
- visitin interface- FeatureVisitor
 
- 
getExpression
- 
getAggregateVisitor
- 
getGroupByAttributes
- 
setValueMethods that allow optimizations to directly set the group by visitor result instead of computing it visiting all the features. Aggregate visitor results are wrapped with the appropriate feature calculation type.- Parameters:
- value- the group by visitor result
 
- 
getExpressionsDescription copied from interface:FeatureAttributeVisitorList of expressions used by visitor.- Specified by:
- getExpressionsin interface- FeatureAttributeVisitor
 
- 
getResultTypeDescription copied from interface:FeatureAttributeVisitorReturns the expected output type given the input type.- Specified by:
- getResultTypein interface- FeatureAttributeVisitor
- Parameters:
- inputTypes- The type of the input expressions
 
 
-