Class ContextualParameter<T>
java.lang.Object
org.apache.sis.io.wkt.FormattableObject
org.apache.sis.parameter.DefaultParameterValue<T>
org.apache.sis.referencing.operation.transform.ContextualParameter<T>
- Type Parameters:
T
- the type of the value stored in this parameter.
- All Implemented Interfaces:
Serializable
,Cloneable
,LenientComparable
,org.opengis.parameter.GeneralParameterValue
,org.opengis.parameter.ParameterValue<T>
A parameter value stored in
ContextualParameters
before they are made unmodifiable.
This temporary ParameterValue
bypasses the validity check normally performed by DefaultParameterValue
.
Rational:
The intent is to skip the parameter value verification done by
Note that the DefaultParameterValue.setValue(Object, Unit)
on the assumption that the value has already been verified when the user created his ParameterValueGroup
.
Even if the user's ParameterValue
implementation did not performed any verification, there is chances that
DefaultMathTransformFactory
copied the parameters in
instances of the org.apache.sis.parameter
package that do the checks.
Skipping redundant verifications allows us to avoid redundant logging messages when
the Semaphores.SUSPEND_PARAMETER_CHECK
flag is set.
Furthermore, it is a little bit late for checking parameter validity here; that verification should have been done
at AbstractMathTransform
construction time or even before, and the job of the ContextualParameters
class is just to record what have been used.
ContextualParameters.freeze()
method will replace all ParameterValue
instances by
UnmodifiableParameterValue
instances anyway. So no matter which temporary instance we used, we will end
with the same objects in memory anyway.- Since:
- 0.7
- Version:
- 0.7
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final long
For cross-version compatibility.Fields inherited from class org.apache.sis.parameter.DefaultParameterValue
unit, value
-
Constructor Summary
ConstructorsConstructorDescriptionContextualParameter
(org.opengis.parameter.ParameterDescriptor<T> descriptor) Creates a parameter value from the specified descriptor. -
Method Summary
Methods inherited from class org.apache.sis.parameter.DefaultParameterValue
booleanValue, clone, doubleValue, doubleValue, doubleValueList, doubleValueList, equals, equals, formatTo, getDescriptor, getUnit, getValue, hashCode, intValue, intValueList, setValue, setValue, setValue, setValue, setValue, setValue, stringValue, unmodifiable, validate, valueFile
Methods inherited from class org.apache.sis.io.wkt.FormattableObject
print, toString, toString, toWKT
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor cross-version compatibility.- See Also:
-
-
Constructor Details
-
ContextualParameter
ContextualParameter(org.opengis.parameter.ParameterDescriptor<T> descriptor) Creates a parameter value from the specified descriptor. The value will be initialized to the default value, if any.- Parameters:
descriptor
- the abstract definition of this parameter.
-
-
Method Details
-
setValue
Sets the parameter value and its associated unit without any verification of parameter validity (except value type).- Overrides:
setValue
in classDefaultParameterValue<T>
- Parameters:
value
- the parameter value, ornull
to restore the default.unit
- the unit associated to the new parameter value, ornull
.- See Also:
-