Package org.geotools.styling
Class AbstractContrastMethodStrategy
- Object
-
- AbstractContrastMethodStrategy
-
- All Implemented Interfaces:
ContrastMethodStrategy
- Direct Known Subclasses:
ExponentialContrastMethodStrategy
,HistogramContrastMethodStrategy
,LogarithmicContrastMethodStrategy
,NormalizeContrastMethodStrategy
public abstract class AbstractContrastMethodStrategy extends Object implements ContrastMethodStrategy
- Author:
- ian
-
-
Field Summary
Fields Modifier and Type Field Description static String
ALGORITHM
ALGORITHMprotected FilterFactory
filterFactory
protected ContrastMethod
method
-
Constructor Summary
Constructors Constructor Description AbstractContrastMethodStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addOption(String key, Expression value)
Add a VendorOption that controls how this strategy operates.void
addParameter(String key, Expression value)
A parameter to be used by this method.Expression
getAlgorithm()
Find out the algorithm used by this method.FilterFactory
getFilterFactory()
Fetch the filter factory used by the method.ContrastMethod
getMethod()
Get the constant that defines the method that this strategy uses.Map<String,Expression>
getOptions()
The map of VendorOptions to write into an SLD or CSS file.Map<String,Expression>
getParameters()
Fetch any parameters which control the method.String
name()
the name of the ContrastMethod Currently one of Normalize, Histogram, Exponential & Logarithmicvoid
setAlgorithm(Expression name)
The algorithm to be used by this method.void
setMethod(ContrastMethod method)
Set the constant that defines the method that this strategy uses.void
setOptions(Map<String,Expression> options)
set the map of VendorOptions to control this method.
-
-
-
Field Detail
-
ALGORITHM
public static final String ALGORITHM
ALGORITHM- See Also:
- Constant Field Values
-
filterFactory
protected FilterFactory filterFactory
-
method
protected ContrastMethod method
-
-
Method Detail
-
setOptions
public void setOptions(Map<String,Expression> options)
set the map of VendorOptions to control this method.- Specified by:
setOptions
in interfaceContrastMethodStrategy
- Parameters:
options
- a map of Expressions keyed by name.
-
getAlgorithm
public Expression getAlgorithm()
Find out the algorithm used by this method.- Returns:
- an Expression which evaluates to the algorithm name, may be null;
-
getParameters
public Map<String,Expression> getParameters()
Fetch any parameters which control the method.Note this does not contain the algorithm value.
- Returns:
- a map of Expressions keyed by parameter name.
-
name
public String name()
the name of the ContrastMethod Currently one of Normalize, Histogram, Exponential & LogarithmicMore methods may be added in future releases.
- Returns:
- A string containing the name of the method.
-
getFilterFactory
public FilterFactory getFilterFactory()
Fetch the filter factory used by the method.- Returns:
- the filter factory.
-
addParameter
public void addParameter(String key, Expression value)
A parameter to be used by this method. Subclasses can implement checks for valid parameter names by overriding this method.- Parameters:
key
- the name of the parametervalue
- the expression that is it's value.
-
setAlgorithm
public void setAlgorithm(Expression name)
The algorithm to be used by this method. Subclasses can implement checks for valid algorithms by overriding this method.- Parameters:
name
- the expression that evaluates to the algorithm name.
-
getOptions
public Map<String,Expression> getOptions()
The map of VendorOptions to write into an SLD or CSS file.- Specified by:
getOptions
in interfaceContrastMethodStrategy
- Returns:
- options a map containing the algorithm name and any parameters that have been set.
-
getMethod
public ContrastMethod getMethod()
Description copied from interface:ContrastMethodStrategy
Get the constant that defines the method that this strategy uses.- Specified by:
getMethod
in interfaceContrastMethodStrategy
- Returns:
- the method that these values relate to.
-
addOption
public void addOption(String key, Expression value)
Description copied from interface:ContrastMethodStrategy
Add a VendorOption that controls how this strategy operates. All VendorOptions are optional and the strategy will operate using default values if missing.- Specified by:
addOption
in interfaceContrastMethodStrategy
- Parameters:
key
- the name of the Vendor Optionvalue
- an expression that evaluates to the value of the option.
-
setMethod
public void setMethod(ContrastMethod method)
Description copied from interface:ContrastMethodStrategy
Set the constant that defines the method that this strategy uses.- Specified by:
setMethod
in interfaceContrastMethodStrategy
- Parameters:
method
- the method to set
-
-