A single parameter value used by an operation method. {@code ParameterValue} instances are elements ina {@linkplain DefaultParameterValueGroup parameter value group}, in a way similar to {@code Map.Entry}instances in a {@code java.util.Map}.
In the context of coordinate operations, most parameter values are numeric and can be obtained by the {@link #intValue()} or {@link #doubleValue()} methods. But other types of parameter values are possibleand can be handled by the more generic {@link #getValue()} and {@link #setValue(Object)} methods.All {@code xxxValue()} methods in this class are convenience methods converting the value from {@code Object}to some commonly used types. Those types are specified in ISO 19111 as an union of attributes, listed below with the corresponding getter and setter methods:
ISO attribute | Java type | Getter method | Setter method |
| {@link Object} | {@link #getValue()} | {@link #setValue(Object)} |
stringValue | {@link String} | {@link #stringValue()} | {@link #setValue(Object)} |
value | {@code double} | {@link #doubleValue()} | {@link #setValue(double)} |
| {@code double} | {@link #doubleValue(Unit)} | {@link #setValue(double,Unit)} |
valueList | {@code double[]} | {@link #doubleValueList()} | {@link #setValue(Object)} |
| {@code double[]} | {@link #doubleValueList(Unit)} | {@link #setValue(double[],Unit)} |
integerValue | {@code int} | {@link #intValue()} | {@link #setValue(int)} |
integerValueList | {@code int[]} | {@link #intValueList()} | {@link #setValue(Object)} |
booleanValue | {@code boolean} | {@link #booleanValue()} | {@link #setValue(boolean)} |
valueFile | {@link URI} | {@link #valueFile()} | {@link #setValue(Object)} |
valueFileCitation | {@link Citation} | {@link #getValue()} | {@link #setValue(Object)} |
The type and constraints on parameter values are given by the {@linkplain #getDescriptor() descriptor}, which is specified at construction time. The parameter type can be fetch with the following idiom: {@preformat javaClass
valueClass = parameter.getDescriptor().getValueClass();}{@section Instantiation}A {@linkplain DefaultParameterDescriptor parameter descriptor} must be defined before parameter value can be created.Descriptors are usually pre-defined by map projection or process providers. Given a descriptor, a parameter value can be created by a call to the {@link #DefaultParameterValue(ParameterDescriptor)} constructor or by a call to the{@link ParameterDescriptor#createValue()} method. The later is recommended since it allows descriptors to returnspecialized implementations. {@section Implementation note for subclasses}All read and write operations (except constructors, {@link #equals(Object)} and {@link #hashCode()}) ultimately delegates to the following methods: - All getter methods will invoke {@link #getValue()} and {@link #getUnit()} (if needed),then perform their processing on the values returned by those methods.
- All setter methods delegates to the {@link #setValue(Object,Unit)} method.
Consequently, the above-cited methods provide single points that subclasses can override for modifying the behavior of all getter and setter methods.
@param < T> The value type.
@author Martin Desruisseaux (IRD, Geomatys)
@since 0.4 (derived from geotk-2.0)
@version 0.4
@module
@see DefaultParameterDescriptor
@see DefaultParameterValueGroup