Class UnmodifiableParameterValue<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>

final class UnmodifiableParameterValue<T> extends DefaultParameterValue<T>
A parameter value which cannot be modified. This implementation shall be used only with: If the parameter value implements the Cloneable interface and has a public clone() method, then that value will be cloned every time the getValue() method is invoked. The value is not cloned by this method however; it is caller's responsibility to not modify the value of the given parameter instance after this method call.

Instances sharing

If the create(ParameterValue) method is invoked more than once with equal descriptor, value and unit, then the method will return the same UnmodifiableParameterValue instance on a best effort basis.
Rational: the same parameter value is often used in many different coordinate operations. For example, all Universal Transverse Mercator (UTM) projections use the same scale factor (0.9996) and false easting (500000 metres).
Since:
0.6
Version:
1.3
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      For cross-version compatibility.
      See Also:
    • POOL

      private static final WeakHashSet<UnmodifiableParameterValue> POOL
      Pool of parameter instances created in this running JVM. See class javadoc for a rational about why we use a pool.
  • Constructor Details

    • UnmodifiableParameterValue

      private UnmodifiableParameterValue(org.opengis.parameter.ParameterValue<T> value)
      Creates a new parameter with the same value than the given one.
  • Method Details