org.geotools.filter
Interface FilterFactory

All Superinterfaces:
Factory, org.opengis.filter.FilterFactory
All Known Implementing Classes:
Expr, FilterFactoryImpl

public interface FilterFactory
extends Factory, org.opengis.filter.FilterFactory

This specifies the interface to create filters.

Version:
$Id: FilterFactory.java 18021 2006-02-14 20:36:18Z jdeolive $
Task:
TODO: This needs to be massively overhauled. This should be the source of immutability of filters. See FeatureTypeFactory, as that provides a good example of what this should look like. The mutable factory to create immutable objects is a good model for this. The creation methods should only create fully formed filters. This in turn means that all the set functions in the filters should be eliminated. When rewriting this class/package, keep in mind FilterSAXParser in the filter module, as the factory should fit cleanly with that, and should handle sax parsing without too much memory overhead., REVISIT: resolve errors, should all throw errors?

Method Summary
 Filter and(Filter f1, Filter f2)
          Deprecated. use FilterFactory.and(org.opengis.filter.Filter, org.opengis.filter.Filter)
 AttributeExpression createAttributeExpression(AttributeType at)
          Deprecated. use createAttributeExpression( at ), will be removed for GeoTools 2.3
 AttributeExpression createAttributeExpression(FeatureType schema)
          Deprecated. use createAttributeExpression(String) instead.
 AttributeExpression createAttributeExpression(FeatureType schema, java.lang.String xpath)
          Deprecated. use createAttributeExpression( xpath ), will be removed for GeoTools 2.3
 AttributeExpression createAttributeExpression(java.lang.String xpath)
          Creates an AttributeExpression using the supplied xpath.
 BBoxExpression createBBoxExpression(com.vividsolutions.jts.geom.Envelope env)
          Creates a BBox Expression from an envelope.
 BetweenFilter createBetweenFilter()
          Creates an empty Between Filter.
 CompareFilter createCompareFilter(short type)
          Deprecated. use one of FilterFactory.less(Expression, Expression) {@link org.opengis.filter.FilterFactory#lessOrEqual(Expression, Expression) {@link org.opengis.filter.FilterFactory#equals(Expression, Expression) {@link org.opengis.filter.FilterFactory#greater(Expression, Expression) {@link org.opengis.filter.FilterFactory#greaterOrEqual(Expression, Expression) {@link org.opengis.filter.FilterFactory#between(Expression, Expression, Expression)
 EnvironmentVariable createEnvironmentVariable(java.lang.String name)
          Creates an Environment Variable
 FidFilter createFidFilter()
          Creates a new Fid Filter with no initial fids.
 FidFilter createFidFilter(java.lang.String fid)
          Creates a Fid Filter with an initial fid.
 FunctionExpression createFunctionExpression(java.lang.String name)
          Creates a Function Expression.
 GeometryDistanceFilter createGeometryDistanceFilter(short filterType)
          Deprecated. use one of {@link org.opengis.filter.FilterFactory#beyond(String, Geometry, double, String) {@link org.opengis.filter.FilterFactory#dwithin(String, Geometry, double, String)
 GeometryFilter createGeometryFilter(short filterType)
          Deprecated. use one of FilterFactory.bbox(String, double, double, double, double, String) {@link org.opengis.filter.FilterFactory#beyond(String, Geometry, double, String) {@link org.opengis.filter.FilterFactory#contains(String, Geometry) {@link org.opengis.filter.FilterFactory#crosses(String, Geometry) {@link org.opengis.filter.FilterFactory#disjoint(String, Geometry) {@link org.opengis.filter.FilterFactory#dwithin(String, Geometry, double, String) {@link org.opengis.filter.FilterFactory#equals(String, Geometry) {@link org.opengis.filter.FilterFactory#intersects(String, Geometry) {@link org.opengis.filter.FilterFactory#overlaps(String, Geometry) {@link org.opengis.filter.FilterFactory#touches(String, Geometry) {@link org.opengis.filter.FilterFactory#within(String, Geometry)
 LikeFilter createLikeFilter()
          Creates a Like Filter.
 LiteralExpression createLiteralExpression()
          Creates an empty Literal Expression
 LiteralExpression createLiteralExpression(double d)
          Creates a Double Literal Expression
 LiteralExpression createLiteralExpression(int i)
          Creates an Integer Literal Expression.
 LiteralExpression createLiteralExpression(java.lang.Object o)
          Creates a Literal Expression from an Object.
 LiteralExpression createLiteralExpression(java.lang.String s)
          Creates a String Literal Expression
 LogicFilter createLogicFilter(Filter filter1, Filter filter2, short filterType)
          Deprecated. use one of FilterFactory.and(Filter, Filter) FilterFactory.or(Filter, Filter) FilterFactory.not(Filter)
 LogicFilter createLogicFilter(Filter filter, short filterType)
          Deprecated. use one of FilterFactory.and(Filter, Filter) FilterFactory.or(Filter, Filter) FilterFactory.not(Filter)
 LogicFilter createLogicFilter(short filterType)
          Deprecated. use one of FilterFactory.and(Filter, Filter) FilterFactory.or(Filter, Filter) FilterFactory.not(Filter)
 MathExpression createMathExpression()
          Deprecated. use one of FilterFactory.add(Expression, Expression) FilterFactory.subtract(Expression, Expression) FilterFactory.multiply(Expression, Expression) FilterFactory.divide(Expression, Expression)
 MathExpression createMathExpression(short expressionType)
          Deprecated. use one of FilterFactory.add(Expression, Expression) FilterFactory.subtract(Expression, Expression) FilterFactory.multiply(Expression, Expression) FilterFactory.divide(Expression, Expression)
 NullFilter createNullFilter()
          Creates an empty Null Filter.
 Filter not(Filter f)
          Deprecated. use FilterFactory.not(org.opengis.filter.Filter)
 Filter or(Filter f1, Filter f2)
          Deprecated. use FilterFactory.or(org.opengis.filter.Filter, org.opengis.filter.Filter)
 
Methods inherited from interface org.geotools.factory.Factory
getImplementationHints
 
Methods inherited from interface org.opengis.filter.FilterFactory
add, and, and, bbox, between, beyond, contains, crosses, disjoint, divide, dwithin, equals, equals, featureId, function, function, function, function, greater, greaterOrEqual, intersects, isNull, less, lessOrEqual, like, like, literal, literal, literal, literal, literal, literal, literal, literal, literal, multiply, not, or, or, overlaps, property, sort, subtract, touches, within
 

Method Detail

createLogicFilter

public LogicFilter createLogicFilter(Filter filter1,
                                     Filter filter2,
                                     short filterType)
                              throws IllegalFilterException
Deprecated. use one of FilterFactory.and(Filter, Filter) FilterFactory.or(Filter, Filter) FilterFactory.not(Filter)

Creates a logic filter from two filters and a type.

Parameters:
filter1 - the first filter to join.
filter2 - the second filter to join.
filterType - must be a logic type.
Returns:
the newly constructed logic filter.
Throws:
IllegalFilterException - If there were any problems creating the filter, including wrong type.

createLogicFilter

public LogicFilter createLogicFilter(short filterType)
                              throws IllegalFilterException
Deprecated. use one of FilterFactory.and(Filter, Filter) FilterFactory.or(Filter, Filter) FilterFactory.not(Filter)

Creates an empty logic filter from a type.

Parameters:
filterType - must be a logic type.
Returns:
the newly constructed logic filter.
Throws:
IllegalFilterException - If there were any problems creating the filter, including wrong type.

createLogicFilter

public LogicFilter createLogicFilter(Filter filter,
                                     short filterType)
                              throws IllegalFilterException
Deprecated. use one of FilterFactory.and(Filter, Filter) FilterFactory.or(Filter, Filter) FilterFactory.not(Filter)

Creates a logic filter with an initial filter..

Parameters:
filter - the initial filter to set.
filterType - Must be a logic type.
Returns:
the newly constructed logic filter.
Throws:
IllegalFilterException - If there were any problems creating the filter, including wrong type.

createBBoxExpression

public BBoxExpression createBBoxExpression(com.vividsolutions.jts.geom.Envelope env)
                                    throws IllegalFilterException
Creates a BBox Expression from an envelope.

Parameters:
env - the envelope to use for this bounding box.
Returns:
The newly created BBoxExpression.
Throws:
IllegalFilterException - if there were creation problems.

createLiteralExpression

public LiteralExpression createLiteralExpression(int i)
Creates an Integer Literal Expression.

Parameters:
i - the int to serve as literal.
Returns:
The new Literal Expression

createMathExpression

public MathExpression createMathExpression()
                                    throws IllegalFilterException
Deprecated. use one of FilterFactory.add(Expression, Expression) FilterFactory.subtract(Expression, Expression) FilterFactory.multiply(Expression, Expression) FilterFactory.divide(Expression, Expression)

Creates a Math Expression

Returns:
The new Math Expression
Throws:
IllegalFilterException - if there were creation problems.

createFidFilter

public FidFilter createFidFilter()
Creates a new Fid Filter with no initial fids.

Returns:
The new Fid Filter.

createAttributeExpression

public AttributeExpression createAttributeExpression(java.lang.String xpath)
Creates an AttributeExpression using the supplied xpath.

The supplied xpath can be used to query a varity of content - most notably Features.

Parameters:
xpath - XPath used to retrive value
Returns:
The new Attribtue Expression

createAttributeExpression

public AttributeExpression createAttributeExpression(FeatureType schema,
                                                     java.lang.String xpath)
                                              throws IllegalFilterException
Deprecated. use createAttributeExpression( xpath ), will be removed for GeoTools 2.3

Creates a Attribute Expression given a schema and attribute path.

If you supply a schema, it will be used as a sanitch check for the provided path.

Parameters:
schema - the schema to get the attribute from, or null
xpath - the xPath of the attribute to compare.
Returns:
The new Attribute Expression.
Throws:
IllegalFilterException - if there were creation problems.

createAttributeExpression

public AttributeExpression createAttributeExpression(AttributeType at)
                                              throws IllegalFilterException
Deprecated. use createAttributeExpression( at ), will be removed for GeoTools 2.3

Shortcut the process - will only grab values matching AttributeType.

Parameters:
at -
Returns:
The new Attribtue Expression
Throws:
IllegalFilterException - if there were creation problems

createLiteralExpression

public LiteralExpression createLiteralExpression(java.lang.Object o)
                                          throws IllegalFilterException
Creates a Literal Expression from an Object.

Parameters:
o - the object to serve as the literal.
Returns:
The new Literal Expression
Throws:
IllegalFilterException - if there were creation problems.

createCompareFilter

public CompareFilter createCompareFilter(short type)
                                  throws IllegalFilterException
Deprecated. use one of FilterFactory.less(Expression, Expression) {@link org.opengis.filter.FilterFactory#lessOrEqual(Expression, Expression) {@link org.opengis.filter.FilterFactory#equals(Expression, Expression) {@link org.opengis.filter.FilterFactory#greater(Expression, Expression) {@link org.opengis.filter.FilterFactory#greaterOrEqual(Expression, Expression) {@link org.opengis.filter.FilterFactory#between(Expression, Expression, Expression)

Creates a new compare filter of the given type.

Parameters:
type - the type of comparison - must be a compare type.
Returns:
The new compare filter.
Throws:
IllegalFilterException - if there were creation problems.

createLiteralExpression

public LiteralExpression createLiteralExpression()
Creates an empty Literal Expression

Returns:
The new Literal Expression.

createLiteralExpression

public LiteralExpression createLiteralExpression(java.lang.String s)
Creates a String Literal Expression

Parameters:
s - the string to serve as the literal.
Returns:
The new Literal Expression

createLiteralExpression

public LiteralExpression createLiteralExpression(double d)
Creates a Double Literal Expression

Parameters:
d - the double to serve as the literal.
Returns:
The new Literal Expression

createAttributeExpression

public AttributeExpression createAttributeExpression(FeatureType schema)
Deprecated. use createAttributeExpression(String) instead.

Creates a Attribute Expression with an initial schema.

Parameters:
schema - the schema to create with.
Returns:
The new Attribute Expression.

createMathExpression

public MathExpression createMathExpression(short expressionType)
                                    throws IllegalFilterException
Deprecated. use one of FilterFactory.add(Expression, Expression) FilterFactory.subtract(Expression, Expression) FilterFactory.multiply(Expression, Expression) FilterFactory.divide(Expression, Expression)

Creates a Math Expression of the given type.

Parameters:
expressionType - must be a math expression type.
Returns:
The new Math Expression.
Throws:
IllegalFilterException - if there were creation problems.

createNullFilter

public NullFilter createNullFilter()
Creates an empty Null Filter.

Returns:
The new Null Filter.

createBetweenFilter

public BetweenFilter createBetweenFilter()
                                  throws IllegalFilterException
Creates an empty Between Filter.

Returns:
The new Between Filter.
Throws:
IllegalFilterException - if there were creation problems.

createGeometryFilter

public GeometryFilter createGeometryFilter(short filterType)
                                    throws IllegalFilterException
Deprecated. use one of FilterFactory.bbox(String, double, double, double, double, String) {@link org.opengis.filter.FilterFactory#beyond(String, Geometry, double, String) {@link org.opengis.filter.FilterFactory#contains(String, Geometry) {@link org.opengis.filter.FilterFactory#crosses(String, Geometry) {@link org.opengis.filter.FilterFactory#disjoint(String, Geometry) {@link org.opengis.filter.FilterFactory#dwithin(String, Geometry, double, String) {@link org.opengis.filter.FilterFactory#equals(String, Geometry) {@link org.opengis.filter.FilterFactory#intersects(String, Geometry) {@link org.opengis.filter.FilterFactory#overlaps(String, Geometry) {@link org.opengis.filter.FilterFactory#touches(String, Geometry) {@link org.opengis.filter.FilterFactory#within(String, Geometry)

Creates a Geometry Filter.

Parameters:
filterType - the type to create, must be a geometry type.
Returns:
The new Geometry Filter.
Throws:
IllegalFilterException - if the filterType is not a geometry.

createGeometryDistanceFilter

public GeometryDistanceFilter createGeometryDistanceFilter(short filterType)
                                                    throws IllegalFilterException
Deprecated. use one of {@link org.opengis.filter.FilterFactory#beyond(String, Geometry, double, String) {@link org.opengis.filter.FilterFactory#dwithin(String, Geometry, double, String)

Creates a Geometry Distance Filter

Parameters:
filterType - the type to create, must be beyond or dwithin.
Returns:
The new Expression
Throws:
IllegalFilterException - if the filterType is not a geometry distance type.

createFidFilter

public FidFilter createFidFilter(java.lang.String fid)
Creates a Fid Filter with an initial fid.

Parameters:
fid - the feature ID to create with.
Returns:
The new FidFilter.

createLikeFilter

public LikeFilter createLikeFilter()
Creates a Like Filter.

Returns:
The new Like Filter.

createFunctionExpression

public FunctionExpression createFunctionExpression(java.lang.String name)
Creates a Function Expression.

Parameters:
name - the function name.
Returns:
The new Function Expression.

createEnvironmentVariable

public EnvironmentVariable createEnvironmentVariable(java.lang.String name)
Creates an Environment Variable

Parameters:
name - the function name.
Returns:
The new Function Expression.

or

public Filter or(Filter f1,
                 Filter f2)
Deprecated. use FilterFactory.or(org.opengis.filter.Filter, org.opengis.filter.Filter)


and

public Filter and(Filter f1,
                  Filter f2)
Deprecated. use FilterFactory.and(org.opengis.filter.Filter, org.opengis.filter.Filter)


not

public Filter not(Filter f)
Deprecated. use FilterFactory.not(org.opengis.filter.Filter)



Copyright © GeoTools. All Rights Reserved.