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 StringALGORITHMALGORITHMprotected FilterFactoryfilterFactoryprotected ContrastMethodmethod
-
Constructor Summary
Constructors Constructor Description AbstractContrastMethodStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddOption(String key, Expression value)Add a VendorOption that controls how this strategy operates.voidaddParameter(String key, Expression value)A parameter to be used by this method.ExpressiongetAlgorithm()Find out the algorithm used by this method.FilterFactorygetFilterFactory()Fetch the filter factory used by the method.ContrastMethodgetMethod()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.Stringname()the name of the ContrastMethod Currently one of Normalize, Histogram, Exponential & LogarithmicvoidsetAlgorithm(Expression name)The algorithm to be used by this method.voidsetMethod(ContrastMethod method)Set the constant that defines the method that this strategy uses.voidsetOptions(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:
setOptionsin 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:
getOptionsin interfaceContrastMethodStrategy- Returns:
- options a map containing the algorithm name and any parameters that have been set.
-
getMethod
public ContrastMethod getMethod()
Description copied from interface:ContrastMethodStrategyGet the constant that defines the method that this strategy uses.- Specified by:
getMethodin interfaceContrastMethodStrategy- Returns:
- the method that these values relate to.
-
addOption
public void addOption(String key, Expression value)
Description copied from interface:ContrastMethodStrategyAdd a VendorOption that controls how this strategy operates. All VendorOptions are optional and the strategy will operate using default values if missing.- Specified by:
addOptionin 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:ContrastMethodStrategySet the constant that defines the method that this strategy uses.- Specified by:
setMethodin interfaceContrastMethodStrategy- Parameters:
method- the method to set
-
-