org.geotools.filter
Class FilterFactoryImpl

Object
  extended by FilterFactoryImpl
All Implemented Interfaces:
Factory, FilterFactory, FilterFactory2

public class FilterFactoryImpl
extends Object
implements FilterFactory

Implementation of the FilterFactory, generates the filter implementations in defaultcore.

Author:
Ian Turton, CCG
Module:
modules/library/main (gt-main.jar)

Constructor Summary
FilterFactoryImpl()
          Creates a new instance of FilterFactoryImpl
FilterFactoryImpl(Hints hints)
           
 
Method Summary
 Add add(Expression expr1, Expression expr2)
           
 And and(Filter f, Filter g)
           
 Filter and(Filter filter1, Filter filter2)
           
 And and(List filters)
           
 ArithmeticOperators arithmeticOperators(boolean simple, Functions functions)
           
 BBOX bbox(Expression geometry, BoundingBox bounds)
           
 BBOX bbox(Expression e, double minx, double miny, double maxx, double maxy, String srs)
           
 BBOX bbox(Expression geometry, Expression bounds)
           
 BBOX bbox(String propertyName, double minx, double miny, double maxx, double maxy, String srs)
          Checks if the bounding box of the feature's geometry overlaps the specified bounding box.
 PropertyIsBetween between(Expression expr, Expression lower, Expression upper)
           
 Beyond beyond(Expression geometry1, Expression geometry2, double distance, String units)
           
 Beyond beyond(Expression geometry1, Geometry geometry2, double distance, String units)
           
 Beyond beyond(String propertyName, Geometry geometry, double distance, String units)
           
 FilterCapabilities capabilities(String version, ScalarCapabilities scalar, SpatialCapabilities spatial, IdCapabilities id)
           
 ComparisonOperators comparisonOperators(Operator[] comparisonOperators)
           
 Contains contains(Expression geometry1, Expression geometry2)
           
 Contains contains(String propertyName, Geometry geometry)
           
 AttributeExpression createAttributeExpression(AttributeDescriptor at)
           
 AttributeExpression createAttributeExpression(SimpleFeatureType schema)
          Creates a Attribute Expression with an initial schema.
 AttributeExpression createAttributeExpression(SimpleFeatureType schema, String path)
          Creates a Attribute Expression given a schema and attribute path.
 AttributeExpression createAttributeExpression(String xpath)
          Creates an AttributeExpression using the supplied xpath.
 BBoxExpression createBBoxExpression(Envelope env)
          Creates a BBox Expression from an envelope.
 BetweenFilter createBetweenFilter()
          Creates an empty Between Filter.
 CompareFilter createCompareFilter(short type)
          Deprecated. @see org.geotools.filter.FilterFactory#createCompareFilter(short)
 EnvironmentVariable createEnvironmentVariable(String name)
           
 FidFilter createFidFilter()
          Creates a new Fid Filter with no initial fids.
 FidFilter createFidFilter(String fid)
          Creates a Fid Filter with an initial fid.
 FunctionExpression createFunctionExpression(String name)
          Creates a Function Expression.
 GeometryDistanceFilter createGeometryDistanceFilter(short filterType)
          Creates a Geometry Distance Filter
 GeometryFilter createGeometryFilter(short filterType)
          Creates a Geometry Filter.
 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(Object o)
          Creates a Literal Expression from an Object.
 LiteralExpression createLiteralExpression(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)
          Creates a Math Expression of the given type.
 NullFilter createNullFilter()
          Creates an empty Null Filter.
 Crosses crosses(Expression geometry1, Expression geometry2)
           
 Crosses crosses(String propertyName, Geometry geometry)
           
 Disjoint disjoint(Expression geometry1, Expression geometry2)
           
 Disjoint disjoint(String propertyName, Geometry geometry)
           
 Divide divide(Expression expr1, Expression expr2)
           
 DWithin dwithin(Expression geometry1, Expression geometry2, double distance, String units)
           
 DWithin dwithin(String propertyName, Geometry geometry, double distance, String units)
           
 Equals equal(Expression geometry1, Expression geometry2)
           
 PropertyIsEqualTo equal(Expression expr1, Expression expr2, boolean matchCase)
           
 PropertyIsEqualTo equals(Expression expr1, Expression expr2)
           
 Equals equals(String propertyName, Geometry geometry)
           
 FeatureId featureId(String id)
           
 Function function(String name, Expression arg1)
           
 Function function(String name, Expression[] args)
           
 Function function(String name, Expression arg1, Expression arg2)
           
 Function function(String name, Expression arg1, Expression arg2, Expression arg3)
           
 Function function(String name, List<Expression> parameters, Literal fallback)
          Deprecated. Pending see org.opengis.filter.Factory2
 FunctionName functionName(String name, int nargs)
           
 Functions functions(FunctionName[] functionNames)
           
 Map getImplementationHints()
          Map of hints (maybe unmodifiable) used by this factory to customize its use.
 GmlObjectId gmlObjectId(String id)
           
 PropertyIsGreaterThan greater(Expression expr1, Expression expr2)
           
 PropertyIsGreaterThan greater(Expression expr1, Expression expr2, boolean matchCase)
           
 PropertyIsGreaterThanOrEqualTo greaterOrEqual(Expression expr1, Expression expr2)
           
 PropertyIsGreaterThanOrEqualTo greaterOrEqual(Expression expr1, Expression expr2, boolean matchCase)
           
 Id id(Set id)
           
 IdCapabilities idCapabilities(boolean eid, boolean fid)
           
 Intersects intersects(Expression geometry1, Expression geometry2)
           
 Intersects intersects(String propertyName, Geometry geometry)
           
 PropertyIsNull isNull(Expression expr)
          XXX Java 5 type narrowing used to make generated class explicit for chaining
 PropertyIsLessThan less(Expression expr1, Expression expr2)
           
 PropertyIsLessThan less(Expression expr1, Expression expr2, boolean matchCase)
           
 PropertyIsLessThanOrEqualTo lessOrEqual(Expression expr1, Expression expr2)
           
 PropertyIsLessThanOrEqualTo lessOrEqual(Expression expr1, Expression expr2, boolean matchCase)
           
 PropertyIsLike like(Expression expr, String pattern)
           
 PropertyIsLike like(Expression expr, String pattern, String wildcard, String singleChar, String escape)
           
 PropertyIsLike like(Expression expr, String pattern, String wildcard, String singleChar, String escape, boolean matchCase)
           
 Literal literal(boolean b)
           
 Literal literal(byte b)
           
 Literal literal(char c)
           
 Literal literal(double d)
           
 Literal literal(float f)
           
 Literal literal(int i)
           
 Literal literal(long l)
           
 Literal literal(Object obj)
           
 Literal literal(short s)
           
 Multiply multiply(Expression expr1, Expression expr2)
           
 Not not(Filter filter)
          Java 5 type narrowing used to advertise explicit implementation for chaining
 Filter not(Filter filter)
           
 PropertyIsNotEqualTo notEqual(Expression expr1, Expression expr2)
           
 PropertyIsNotEqualTo notEqual(Expression expr1, Expression expr2, boolean matchCase)
           
 Operator operator(String name)
           
 Or or(Filter f, Filter g)
           
 Filter or(Filter filter1, Filter filter2)
           
 Or or(List filters)
           
 Overlaps overlaps(Expression geometry1, Expression geometry2)
           
 Overlaps overlaps(String propertyName, Geometry geometry)
           
 PropertyName property(Name name)
           
 PropertyName property(String name)
           
 ScalarCapabilities scalarCapabilities(ComparisonOperators comparison, ArithmeticOperators arithmetic, boolean logicalOperators)
           
 SortBy sort(String propertyName, SortOrder order)
           
 SpatialCapabilities spatialCapabilities(GeometryOperand[] geometryOperands, SpatialOperators spatial)
           
 SpatialOperator spatialOperator(String name, GeometryOperand[] geometryOperands)
           
 SpatialOperators spatialOperators(SpatialOperator[] spatialOperators)
           
 Subtract subtract(Expression expr1, Expression expr2)
           
 Touches touches(Expression geometry1, Expression geometry2)
           
 Touches touches(String propertyName, Geometry geometry)
           
 Within within(Expression geometry1, Expression geometry2)
           
 Within within(Expression geometry1, Geometry geometry2)
           
 Within within(String propertyName, Geometry geometry)
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilterFactoryImpl

public FilterFactoryImpl()
Creates a new instance of FilterFactoryImpl


FilterFactoryImpl

public FilterFactoryImpl(Hints hints)
Method Detail

featureId

public FeatureId featureId(String id)
Specified by:
featureId in interface FilterFactory

gmlObjectId

public GmlObjectId gmlObjectId(String id)
Specified by:
gmlObjectId in interface FilterFactory

and

public And and(Filter f,
               Filter g)
Specified by:
and in interface FilterFactory

and

public And and(List filters)
Specified by:
and in interface FilterFactory

or

public Or or(Filter f,
             Filter g)
Specified by:
or in interface FilterFactory

or

public Or or(List filters)
Specified by:
or in interface FilterFactory

not

public Not not(Filter filter)
Java 5 type narrowing used to advertise explicit implementation for chaining

Specified by:
not in interface FilterFactory

id

public Id id(Set id)
Specified by:
id in interface FilterFactory

property

public PropertyName property(String name)
Specified by:
property in interface FilterFactory

between

public PropertyIsBetween between(Expression expr,
                                 Expression lower,
                                 Expression upper)
Specified by:
between in interface FilterFactory

equals

public PropertyIsEqualTo equals(Expression expr1,
                                Expression expr2)
Specified by:
equals in interface FilterFactory

equal

public PropertyIsEqualTo equal(Expression expr1,
                               Expression expr2,
                               boolean matchCase)
Specified by:
equal in interface FilterFactory

notEqual

public PropertyIsNotEqualTo notEqual(Expression expr1,
                                     Expression expr2)
Specified by:
notEqual in interface FilterFactory

notEqual

public PropertyIsNotEqualTo notEqual(Expression expr1,
                                     Expression expr2,
                                     boolean matchCase)
Specified by:
notEqual in interface FilterFactory

greater

public PropertyIsGreaterThan greater(Expression expr1,
                                     Expression expr2)
Specified by:
greater in interface FilterFactory

greater

public PropertyIsGreaterThan greater(Expression expr1,
                                     Expression expr2,
                                     boolean matchCase)
Specified by:
greater in interface FilterFactory

greaterOrEqual

public PropertyIsGreaterThanOrEqualTo greaterOrEqual(Expression expr1,
                                                     Expression expr2)
Specified by:
greaterOrEqual in interface FilterFactory

greaterOrEqual

public PropertyIsGreaterThanOrEqualTo greaterOrEqual(Expression expr1,
                                                     Expression expr2,
                                                     boolean matchCase)
Specified by:
greaterOrEqual in interface FilterFactory

less

public PropertyIsLessThan less(Expression expr1,
                               Expression expr2)
Specified by:
less in interface FilterFactory

less

public PropertyIsLessThan less(Expression expr1,
                               Expression expr2,
                               boolean matchCase)
Specified by:
less in interface FilterFactory

lessOrEqual

public PropertyIsLessThanOrEqualTo lessOrEqual(Expression expr1,
                                               Expression expr2)
Specified by:
lessOrEqual in interface FilterFactory

lessOrEqual

public PropertyIsLessThanOrEqualTo lessOrEqual(Expression expr1,
                                               Expression expr2,
                                               boolean matchCase)
Specified by:
lessOrEqual in interface FilterFactory

like

public PropertyIsLike like(Expression expr,
                           String pattern)
Specified by:
like in interface FilterFactory

like

public PropertyIsLike like(Expression expr,
                           String pattern,
                           String wildcard,
                           String singleChar,
                           String escape)
Specified by:
like in interface FilterFactory

like

public PropertyIsLike like(Expression expr,
                           String pattern,
                           String wildcard,
                           String singleChar,
                           String escape,
                           boolean matchCase)
Specified by:
like in interface FilterFactory
Specified by:
like in interface FilterFactory2

isNull

public PropertyIsNull isNull(Expression expr)
XXX Java 5 type narrowing used to make generated class explicit for chaining

Specified by:
isNull in interface FilterFactory

bbox

public BBOX bbox(String propertyName,
                 double minx,
                 double miny,
                 double maxx,
                 double maxy,
                 String srs)
Checks if the bounding box of the feature's geometry overlaps the specified bounding box.

Similar to: geom().disjoint( geom( bbox )).not()

Specified by:
bbox in interface FilterFactory

bbox

public BBOX bbox(Expression geometry,
                 Expression bounds)

bbox

public BBOX bbox(Expression geometry,
                 BoundingBox bounds)
Specified by:
bbox in interface FilterFactory2

bbox

public BBOX bbox(Expression e,
                 double minx,
                 double miny,
                 double maxx,
                 double maxy,
                 String srs)
Specified by:
bbox in interface FilterFactory2

beyond

public Beyond beyond(String propertyName,
                     Geometry geometry,
                     double distance,
                     String units)
Specified by:
beyond in interface FilterFactory

beyond

public Beyond beyond(Expression geometry1,
                     Expression geometry2,
                     double distance,
                     String units)
Specified by:
beyond in interface FilterFactory2

contains

public Contains contains(String propertyName,
                         Geometry geometry)
Specified by:
contains in interface FilterFactory

contains

public Contains contains(Expression geometry1,
                         Expression geometry2)
Specified by:
contains in interface FilterFactory2

crosses

public Crosses crosses(String propertyName,
                       Geometry geometry)
Specified by:
crosses in interface FilterFactory

crosses

public Crosses crosses(Expression geometry1,
                       Expression geometry2)
Specified by:
crosses in interface FilterFactory2

disjoint

public Disjoint disjoint(String propertyName,
                         Geometry geometry)
Specified by:
disjoint in interface FilterFactory

disjoint

public Disjoint disjoint(Expression geometry1,
                         Expression geometry2)
Specified by:
disjoint in interface FilterFactory2

dwithin

public DWithin dwithin(String propertyName,
                       Geometry geometry,
                       double distance,
                       String units)
Specified by:
dwithin in interface FilterFactory

dwithin

public DWithin dwithin(Expression geometry1,
                       Expression geometry2,
                       double distance,
                       String units)
Specified by:
dwithin in interface FilterFactory2

equals

public Equals equals(String propertyName,
                     Geometry geometry)
Specified by:
equals in interface FilterFactory

equal

public Equals equal(Expression geometry1,
                    Expression geometry2)
Specified by:
equal in interface FilterFactory2

intersects

public Intersects intersects(String propertyName,
                             Geometry geometry)
Specified by:
intersects in interface FilterFactory

intersects

public Intersects intersects(Expression geometry1,
                             Expression geometry2)
Specified by:
intersects in interface FilterFactory2

overlaps

public Overlaps overlaps(String propertyName,
                         Geometry geometry)
Specified by:
overlaps in interface FilterFactory

overlaps

public Overlaps overlaps(Expression geometry1,
                         Expression geometry2)
Specified by:
overlaps in interface FilterFactory2

touches

public Touches touches(String propertyName,
                       Geometry geometry)
Specified by:
touches in interface FilterFactory

touches

public Touches touches(Expression geometry1,
                       Expression geometry2)
Specified by:
touches in interface FilterFactory2

within

public Within within(String propertyName,
                     Geometry geometry)
Specified by:
within in interface FilterFactory

within

public Within within(Expression geometry1,
                     Expression geometry2)
Specified by:
within in interface FilterFactory2

add

public Add add(Expression expr1,
               Expression expr2)
Specified by:
add in interface FilterFactory

divide

public Divide divide(Expression expr1,
                     Expression expr2)
Specified by:
divide in interface FilterFactory

multiply

public Multiply multiply(Expression expr1,
                         Expression expr2)
Specified by:
multiply in interface FilterFactory

subtract

public Subtract subtract(Expression expr1,
                         Expression expr2)
Specified by:
subtract in interface FilterFactory

function

public Function function(String name,
                         Expression[] args)
Specified by:
function in interface FilterFactory

function

public Function function(String name,
                         Expression arg1)

function

public Function function(String name,
                         Expression arg1,
                         Expression arg2)

function

public Function function(String name,
                         List<Expression> parameters,
                         Literal fallback)
Deprecated. Pending see org.opengis.filter.Factory2


function

public Function function(String name,
                         Expression arg1,
                         Expression arg2,
                         Expression arg3)

literal

public Literal literal(Object obj)
Specified by:
literal in interface FilterFactory

literal

public Literal literal(byte b)
Specified by:
literal in interface FilterFactory

literal

public Literal literal(short s)
Specified by:
literal in interface FilterFactory

literal

public Literal literal(int i)
Specified by:
literal in interface FilterFactory

literal

public Literal literal(long l)
Specified by:
literal in interface FilterFactory

literal

public Literal literal(float f)
Specified by:
literal in interface FilterFactory

literal

public Literal literal(double d)
Specified by:
literal in interface FilterFactory

literal

public Literal literal(char c)
Specified by:
literal in interface FilterFactory

literal

public Literal literal(boolean b)
Specified by:
literal in interface FilterFactory

createAttributeExpression

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

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

Returns:
The new Attribtue Expression

createAttributeExpression

public AttributeExpression createAttributeExpression(SimpleFeatureType schema)
Creates a Attribute Expression with an initial schema.

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

createAttributeExpression

public AttributeExpression createAttributeExpression(SimpleFeatureType schema,
                                                     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 AttributeExpression createAttributeExpression(AttributeDescriptor at)
                                              throws IllegalFilterException
Throws:
IllegalFilterException

createBBoxExpression

public BBoxExpression createBBoxExpression(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.

createBetweenFilter

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

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

createCompareFilter

public CompareFilter createCompareFilter(short type)
                                  throws IllegalFilterException
Deprecated. @see org.geotools.filter.FilterFactory#createCompareFilter(short)

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.

createFidFilter

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

Returns:
The new Fid Filter.

createFidFilter

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

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

createGeometryFilter

public 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 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.

createLikeFilter

public LikeFilter createLikeFilter()
Creates a Like Filter.

Returns:
The new Like Filter.

createLiteralExpression

public LiteralExpression createLiteralExpression()
Creates an empty Literal Expression

Returns:
The new Literal Expression.

createLiteralExpression

public LiteralExpression createLiteralExpression(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.

createLiteralExpression

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

Parameters:
i - the int to serve as 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

createLiteralExpression

public LiteralExpression createLiteralExpression(String s)
Creates a String Literal Expression

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

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.

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.

createMathExpression

public MathExpression createMathExpression()
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

createMathExpression

public 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.

createFunctionExpression

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

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

createNullFilter

public NullFilter createNullFilter()
Creates an empty Null Filter.

Returns:
The new Null Filter.

createEnvironmentVariable

public EnvironmentVariable createEnvironmentVariable(String name)

getImplementationHints

public Map getImplementationHints()
Description copied from interface: Factory
Map of hints (maybe unmodifiable) used by this factory to customize its use. This map is not guaranteed to contains all the hints supplied by the user; it may be only a subset. Consequently, hints provided here are usually not suitable for creating new factories, unless the implementation make some additional garantees (e.g. FactoryUsingVolatileDependencies).

The primary purpose of this method is to determine if an existing factory instance can be reused for a set of user-supplied hints. This method is invoked by FactoryRegistry in order to compare this factory's hints against user's hints. This is dependency introspection only; FactoryRegistry never invokes this method for creating new factories.

Keys are usually static constants from the Hints class, while values are instances of some key-dependent class. The key set must contains at least all hints impacting functionality. While the key set may contains all hints supplied by the user, it is recommended to limit the set to only the hints used by this particular factory instance. A minimal set will helps FactoryRegistry to compare only hints that matter and avoid the creation of unnecessary instances of this factory.

The hint values may be different than the one supplied by the user. If a user supplied a hint as a Class object, this method shall replace it by the actual instance used, if possible.

Implementations of this method are usually quite simple. For example if a datum authority factory uses an ordinary datum factory, its method could be implemented as below (note that we should not check if the datum factory is null, since key with null value is the expected behaviour in this case). Example:


 Map hints = new HashMap();
 hints.put(Hints.DATUM_FACTORY, datumFactory);
 return hints;
 

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

sort

public SortBy sort(String propertyName,
                   SortOrder order)
Specified by:
sort in interface FilterFactory

and

public Filter and(Filter filter1,
                  Filter filter2)

not

public Filter not(Filter filter)

or

public Filter or(Filter filter1,
                 Filter filter2)

beyond

public Beyond beyond(Expression geometry1,
                     Geometry geometry2,
                     double distance,
                     String units)

property

public PropertyName property(Name name)
Specified by:
property in interface FilterFactory2

within

public Within within(Expression geometry1,
                     Geometry geometry2)

operator

public Operator operator(String name)
Specified by:
operator in interface FilterFactory

spatialOperator

public SpatialOperator spatialOperator(String name,
                                       GeometryOperand[] geometryOperands)
Specified by:
spatialOperator in interface FilterFactory

functionName

public FunctionName functionName(String name,
                                 int nargs)
Specified by:
functionName in interface FilterFactory

functions

public Functions functions(FunctionName[] functionNames)
Specified by:
functions in interface FilterFactory

spatialOperators

public SpatialOperators spatialOperators(SpatialOperator[] spatialOperators)
Specified by:
spatialOperators in interface FilterFactory

arithmeticOperators

public ArithmeticOperators arithmeticOperators(boolean simple,
                                               Functions functions)
Specified by:
arithmeticOperators in interface FilterFactory

comparisonOperators

public ComparisonOperators comparisonOperators(Operator[] comparisonOperators)
Specified by:
comparisonOperators in interface FilterFactory

capabilities

public FilterCapabilities capabilities(String version,
                                       ScalarCapabilities scalar,
                                       SpatialCapabilities spatial,
                                       IdCapabilities id)
Specified by:
capabilities in interface FilterFactory

scalarCapabilities

public ScalarCapabilities scalarCapabilities(ComparisonOperators comparison,
                                             ArithmeticOperators arithmetic,
                                             boolean logicalOperators)
Specified by:
scalarCapabilities in interface FilterFactory

spatialCapabilities

public SpatialCapabilities spatialCapabilities(GeometryOperand[] geometryOperands,
                                               SpatialOperators spatial)
Specified by:
spatialCapabilities in interface FilterFactory

idCapabilities

public IdCapabilities idCapabilities(boolean eid,
                                     boolean fid)
Specified by:
idCapabilities in interface FilterFactory


Copyright © 1996-2009 Geotools. All Rights Reserved.