org.geotools.filter
Class FilterFactory

java.lang.Object
  extended byorg.geotools.filter.FilterFactory
All Implemented Interfaces:
Factory
Direct Known Subclasses:
FilterFactoryImpl

public abstract class FilterFactory
extends java.lang.Object
implements Factory

This specifies the interface to create filters.

Version:
$Id: FilterFactory.java,v 1.7 2003/08/07 19:55:22 cholmesny Exp $
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?

Constructor Summary
FilterFactory()
           
 
Method Summary
abstract  AttributeExpression createAttributeExpression(AttributeType at)
           
abstract  AttributeExpression createAttributeExpression(FeatureType schema)
          Creates a Attribute Expression with an initial schema.
abstract  AttributeExpression createAttributeExpression(FeatureType schema, java.lang.String path)
          Creates a Attribute Expression given a schema and attribute path.
abstract  BBoxExpression createBBoxExpression(com.vividsolutions.jts.geom.Envelope env)
          Creates a BBox Expression from an envelope.
abstract  BetweenFilter createBetweenFilter()
          Creates an empty Between Filter.
abstract  CompareFilter createCompareFilter(short type)
          Creates a new compare filter of the given type.
abstract  EnvironmentVariable createEnvironmentVariable(java.lang.String name)
          Creates an Environment Variable
abstract  FidFilter createFidFilter()
          Creates a new Fid Filter with no initial fids.
abstract  FidFilter createFidFilter(java.lang.String fid)
          Creates a Fid Filter with an initial fid.
static FilterFactory createFilterFactory()
          Creates an instance of a Filter factory.
abstract  FunctionExpression createFunctionExpression(java.lang.String name)
          Creates a Function Expression.
abstract  GeometryDistanceFilter createGeometryDistanceFilter(short filterType)
          Creates a Geometry Distance Filter
abstract  GeometryFilter createGeometryFilter(short filterType)
          Creates a Geometry Filter.
abstract  LikeFilter createLikeFilter()
          Creates a Like Filter.
abstract  LiteralExpression createLiteralExpression()
          Creates an empty Literal Expression
abstract  LiteralExpression createLiteralExpression(double d)
          Creates a Double Literal Expression
abstract  LiteralExpression createLiteralExpression(int i)
          Creates an Integer Literal Expression.
abstract  LiteralExpression createLiteralExpression(java.lang.Object o)
          Creates a Literal Expression from an Object.
abstract  LiteralExpression createLiteralExpression(java.lang.String s)
          Creates a String Literal Expression
abstract  LogicFilter createLogicFilter(Filter filter1, Filter filter2, short filterType)
          Creates a logic filter from two filters and a type.
abstract  LogicFilter createLogicFilter(Filter filter, short filterType)
          Creates a logic filter with an initial filter..
abstract  LogicFilter createLogicFilter(short filterType)
          Creates an empty logic filter from a type.
abstract  MathExpression createMathExpression()
          Creates a Math Expression
abstract  MathExpression createMathExpression(short expressionType)
          Creates a Math Expression of the given type.
abstract  NullFilter createNullFilter()
          Creates an empty Null Filter.
 java.util.Map getImplementationHints()
          Returns the implementation hints.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilterFactory

public FilterFactory()
Method Detail

createFilterFactory

public static FilterFactory createFilterFactory()
                                         throws FactoryConfigurationError
Creates an instance of a Filter factory.

Returns:
An instance of the Filter factory.
Throws:
FactoryConfigurationError - If a factory is not found.

createLogicFilter

public abstract LogicFilter createLogicFilter(Filter filter1,
                                              Filter filter2,
                                              short filterType)
                                       throws IllegalFilterException
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 abstract LogicFilter createLogicFilter(short filterType)
                                       throws IllegalFilterException
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 abstract LogicFilter createLogicFilter(Filter filter,
                                              short filterType)
                                       throws IllegalFilterException
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 abstract 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 abstract LiteralExpression createLiteralExpression(int i)
Creates an Integer Literal Expression.

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

createMathExpression

public abstract MathExpression createMathExpression()
                                             throws IllegalFilterException
Creates a Math Expression

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

createFidFilter

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

Returns:
The new Fid Filter.

createAttributeExpression

public abstract AttributeExpression createAttributeExpression(FeatureType schema,
                                                              java.lang.String path)
                                                       throws IllegalFilterException
Creates a Attribute Expression given a schema and attribute path.

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

createAttributeExpression

public abstract AttributeExpression createAttributeExpression(AttributeType at)
                                                       throws IllegalFilterException
Throws:
IllegalFilterException

createLiteralExpression

public abstract 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 abstract CompareFilter createCompareFilter(short type)
                                           throws IllegalFilterException
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 abstract LiteralExpression createLiteralExpression()
Creates an empty Literal Expression

Returns:
The new Literal Expression.

createLiteralExpression

public abstract 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 abstract 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 abstract AttributeExpression createAttributeExpression(FeatureType schema)
Creates a Attribute Expression with an initial schema.

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

createMathExpression

public abstract MathExpression createMathExpression(short expressionType)
                                             throws IllegalFilterException
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 abstract NullFilter createNullFilter()
Creates an empty Null Filter.

Returns:
The new Null Filter.

createBetweenFilter

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

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

createGeometryFilter

public abstract GeometryFilter createGeometryFilter(short filterType)
                                             throws IllegalFilterException
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 abstract GeometryDistanceFilter createGeometryDistanceFilter(short filterType)
                                                             throws IllegalFilterException
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 abstract 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 abstract LikeFilter createLikeFilter()
Creates a Like Filter.

Returns:
The new Like Filter.

createFunctionExpression

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

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

createEnvironmentVariable

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

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

getImplementationHints

public java.util.Map getImplementationHints()
Returns the implementation hints. The default implementation returns en empty map.

Specified by:
getImplementationHints in interface Factory
Returns:
The map of hints, or an empty map if none.


Copyright © GeoTools. All Rights Reserved.