Package org.geotools.feature.visitor
Class UniqueVisitor
Object
UniqueVisitor
- All Implemented Interfaces:
FeatureVisitor,FeatureAttributeVisitor,FeatureCalc,LimitingVisitor
- Direct Known Subclasses:
UniqueCountVisitor
public class UniqueVisitor
extends Object
implements FeatureCalc, FeatureAttributeVisitor, LimitingVisitor
Generates a list of unique values from a collection
- Since:
- 2.2.M2
- Author:
- Cory Horner, Refractions
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionUniqueVisitor(int attributeTypeIndex, SimpleFeatureType type) UniqueVisitor(String... attributeTypeNames) UniqueVisitor(String attrName, SimpleFeatureType type) UniqueVisitor(SimpleFeatureType type, Integer... indexes) UniqueVisitor(SimpleFeatureType type, String... attributeNames) UniqueVisitor(Expression... expressions) -
Method Summary
Modifier and TypeMethodDescriptionList of expressions used by visitor.intReturns maxFeatures (max # of elements to return)Returns the result of the calculation as a handy object which can be merged and modified.getResultType(List<Class> inputTypes) Returns the expected output type given the input type.intReturns startIndex (first element to return)booleanChecks if the visitor has limits.voidinit(SimpleFeatureCollection collection) booleanTrue if the unique visitor must be order preservingvoidreset()voidsetMaxFeatures(int maxFeatures) voidsetPreserveOrder(boolean preserveOrder) voidsetStartIndex(int startIndex) voidvoidVisit the provided feature.voidvisit(SimpleFeature feature)
-
Constructor Details
-
UniqueVisitor
- Throws:
IllegalFilterException
-
UniqueVisitor
- Throws:
IllegalFilterException
-
UniqueVisitor
-
UniqueVisitor
- Throws:
IllegalFilterException
-
UniqueVisitor
public UniqueVisitor(SimpleFeatureType type, String... attributeNames) throws IllegalFilterException - Throws:
IllegalFilterException
-
UniqueVisitor
-
-
Method Details
-
init
-
setStartIndex
public void setStartIndex(int startIndex) -
setMaxFeatures
public void setMaxFeatures(int maxFeatures) -
setPreserveOrder
public void setPreserveOrder(boolean preserveOrder) -
getStartIndex
public int getStartIndex()Description copied from interface:LimitingVisitorReturns startIndex (first element to return)- Specified by:
getStartIndexin interfaceLimitingVisitor
-
getMaxFeatures
public int getMaxFeatures()Description copied from interface:LimitingVisitorReturns maxFeatures (max # of elements to return)- Specified by:
getMaxFeaturesin interfaceLimitingVisitor
-
getExpressions
Description copied from interface:FeatureAttributeVisitorList of expressions used by visitor.- Specified by:
getExpressionsin interfaceFeatureAttributeVisitor
-
getResultType
Description copied from interface:FeatureAttributeVisitorReturns the expected output type given the input type.- Specified by:
getResultTypein interfaceFeatureAttributeVisitor- Parameters:
inputTypes- The type of the input expressions
-
visit
-
visit
Description 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 interfaceFeatureVisitor
-
getExpression
-
getUnique
-
setValue
-
reset
public void reset() -
getResult
Description copied from interface:FeatureCalcReturns the result of the calculation as a handy object which can be merged and modified.- Specified by:
getResultin interfaceFeatureCalc- Returns:
- the results of the calculation
-
getAttrNames
-
hasLimits
public boolean hasLimits()Description copied from interface:LimitingVisitorChecks if the visitor has limits.- Specified by:
hasLimitsin interfaceLimitingVisitor- Returns:
- true if the visitor has limits
-
isPreserveOrder
public boolean isPreserveOrder()True if the unique visitor must be order preserving
-