Class Parameters

Object
Parameters
All Implemented Interfaces:
Cloneable, General­Parameter­Value, Parameter­Value­Group
Direct Known Subclasses:
Contextual­Parameters, Default­Parameter­Value­Group

public abstract class Parameters extends Object implements ParameterValueGroup, Cloneable
Convenience methods for fetching parameter values despite the variations in parameter names, value types and units. See Default­Parameter­Value­Group javadoc for a description of the standard way to get and set a particular parameter in a group. The remaining of this javadoc is specific to Apache SIS.

Convenience methods

This class provides the following convenience static methods: Most instance methods in this class follow the same naming pattern than the methods provided by the Parameter­Value interface. Those methods are themselves inspired by JDK methods:
Methods fetching parameter value
Parameters method ParameterValue method JDK methods
getValue(ParameterDescriptor) getValue()
booleanValue(ParameterDescriptor) booleanValue() Boolean.booleanValue()
intValue(ParameterDescriptor) intValue() Number.intValue()
intValueList(ParameterDescriptor) intValueList()
doubleValue(ParameterDescriptor) doubleValue() Number.doubleValue()
doubleValueList(ParameterDescriptor) doubleValueList()
stringValue(ParameterDescriptor) stringValue()

Fetching parameter values despite different names, types or units

The common way to get a parameter is to invoke the Parameter­Value­Group​.parameter(String) method. This Parameters class provides alternative ways, using a Parameter­Descriptor argument instead of a String argument. Those descriptors provide additional information like the various aliases under which the same parameter may be known. By using this information, Parameters can choose the most appropriate parameter name or alias (by searching for a common authority) when it delegates its work to the parameter(String) method.

Example

The same parameter may be known under different names. For example, the length of the semi-major axis of the ellipsoid is commonly known as "semi_major". But that parameter can also be named "semi_major_axis", "earth_radius" or simply "a" in other libraries. When fetching parameter values, we do not always know in advance which of the above-cited names is recognized by an arbitrary Parameter­Value­Group instance.

Parameters uses also the descriptor information for applying type and unit conversions (i.e. returned values are converted to the units of measurement specified by the given parameter descriptor).

Note for subclass implementers

This class does not implement any method from the Parameter­Value­Group interface (this class is not named “Abstract­Parameter­Value­Group” for that reason). Extending this class or extending Object make almost no difference for implementers; Parameters purpose is mostly to extend the API for users convenience. All methods in this class get their information from the Parameter­Value­Group methods. In addition, unless otherwise specified, methods in this class is isolated from all others: overriding one method has no impact on other methods.
Since:
0.4