Package org.apache.sis.parameter
Class UnmodifiableParameterValueGroup
java.lang.Object
org.apache.sis.parameter.Parameters
org.apache.sis.parameter.UnmodifiableParameterValueGroup
- All Implemented Interfaces:
Serializable
,Cloneable
,LenientComparable
,org.opengis.parameter.GeneralParameterValue
,org.opengis.parameter.ParameterValueGroup
- Direct Known Subclasses:
FilteredParameters
A parameter value group which cannot be modified. This is especially important for parameters of
defining conversions since the same instance can be used for various source and target CRS.
Since
EPSGFactory
caches the Conversion
instances,
unexpected behavior results if the parameters of a cached conversion have been modified, for example with
the addition of semi_major
and semi_minor
parameters by DefaultMathTransformFactory
.- Since:
- 0.7
- Version:
- 1.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.opengis.parameter.ParameterDescriptorGroup
The parameter descriptor.private static final long
Serial number for inter-operability with different versions.private final List<org.opengis.parameter.GeneralParameterValue>
The parameter values. -
Constructor Summary
ConstructorsModifierConstructorDescription(package private)
Creates a copy of the given parameter group.private
UnmodifiableParameterValueGroup
(org.opengis.parameter.ParameterValueGroup group, Map<org.opengis.parameter.ParameterValueGroup, Boolean> done) Creates a new unmodifiable parameter group. -
Method Summary
Modifier and TypeMethodDescriptionfinal org.opengis.parameter.ParameterValueGroup
Operation not allowed.clone()
Returns a modifiable copy of this parameter value group.(package private) static UnmodifiableParameterValueGroup
create
(org.opengis.parameter.ParameterValueGroup group) Creates a new unmodifiable parameter group.final boolean
Compares the specified object with this parameter for equality.boolean
equals
(Object object, ComparisonMode mode) Compares the specified object with this parameter for equality.org.opengis.parameter.ParameterDescriptorGroup
Returns the abstract definition of this group of parameters.List<org.opengis.parameter.ParameterValueGroup>
Returns all subgroups with the specified name.int
hashCode()
Returns a hash value for this parameter.(package private) final boolean
Specifies that this class does not overrideparameter(String)
in a way incompatible withParameters.parameterIfExist(String)
.final org.opengis.parameter.ParameterValue<?>
Returns the value in this group for the specified name.List<org.opengis.parameter.GeneralParameterValue>
values()
Returns the values in this group.Methods inherited from class org.apache.sis.parameter.Parameters
booleanValue, cast, cast, castOrWrap, copy, doubleValue, doubleValue, doubleValueList, getDescriptors, getMandatoryValue, getMemberName, getOrCreate, getParameter, getValue, getValueDomain, intValue, intValueList, isUnmodifiable, parameterIfExist, print, stringValue, toString, unmodifiable, unmodifiable
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerial number for inter-operability with different versions.- See Also:
-
descriptor
private final org.opengis.parameter.ParameterDescriptorGroup descriptorThe parameter descriptor.- See Also:
-
values
The parameter values.- See Also:
-
-
Constructor Details
-
UnmodifiableParameterValueGroup
UnmodifiableParameterValueGroup(UnmodifiableParameterValueGroup group) Creates a copy of the given parameter group. This is used byFilteredParameters
constructor only.- Parameters:
group
- the group of values to copy.
-
UnmodifiableParameterValueGroup
private UnmodifiableParameterValueGroup(org.opengis.parameter.ParameterValueGroup group, Map<org.opengis.parameter.ParameterValueGroup, Boolean> done) Creates a new unmodifiable parameter group.- Parameters:
group
- the group of values to copy.done
- an initially empty map used for protection against circular references.- See Also:
-
-
Method Details
-
create
Creates a new unmodifiable parameter group.- Parameters:
group
- the group of values to copy, ornull
.- Returns:
- the unmodifiable parameter group, or
null
if the given argument was null.
-
getDescriptor
public org.opengis.parameter.ParameterDescriptorGroup getDescriptor()Returns the abstract definition of this group of parameters.- Specified by:
getDescriptor
in interfaceorg.opengis.parameter.GeneralParameterValue
- Specified by:
getDescriptor
in interfaceorg.opengis.parameter.ParameterValueGroup
-
values
Returns the values in this group.- Specified by:
values
in interfaceorg.opengis.parameter.ParameterValueGroup
-
isKnownImplementation
final boolean isKnownImplementation()Specifies that this class does not overrideparameter(String)
in a way incompatible withParameters.parameterIfExist(String)
.- Overrides:
isKnownImplementation
in classParameters
-
parameter
public final org.opengis.parameter.ParameterValue<?> parameter(String name) throws org.opengis.parameter.ParameterNotFoundException Returns the value in this group for the specified name.- Specified by:
parameter
in interfaceorg.opengis.parameter.ParameterValueGroup
- Throws:
org.opengis.parameter.ParameterNotFoundException
-
groups
public List<org.opengis.parameter.ParameterValueGroup> groups(String name) throws org.opengis.parameter.ParameterNotFoundException Returns all subgroups with the specified name.- Specified by:
groups
in interfaceorg.opengis.parameter.ParameterValueGroup
- Throws:
org.opengis.parameter.ParameterNotFoundException
-
addGroup
public final org.opengis.parameter.ParameterValueGroup addGroup(String name) throws IllegalStateException Operation not allowed.- Specified by:
addGroup
in interfaceorg.opengis.parameter.ParameterValueGroup
- Throws:
IllegalStateException
-
clone
Returns a modifiable copy of this parameter value group.- Specified by:
clone
in interfaceorg.opengis.parameter.GeneralParameterValue
- Specified by:
clone
in interfaceorg.opengis.parameter.ParameterValueGroup
- Overrides:
clone
in classParameters
- Returns:
- a copy of this group of parameter values.
- See Also:
-
equals
Compares the specified object with this parameter for equality. The strictness level is controlled by the second argument:ComparisonMode.STRICT
andBY_CONTRACT
take in account the parameter order.ComparisonMode.IGNORE_METADATA
andAPPROXIMATE
ignore the order of parameter values (but not necessarily the order of parameter descriptors).
- Specified by:
equals
in interfaceLenientComparable
- Parameters:
object
- the object to compare tothis
.mode
- the strictness level of the comparison.- Returns:
true
if both objects are equal according the given comparison mode.- See Also:
-
equals
Compares the specified object with this parameter for equality.- Specified by:
equals
in interfaceLenientComparable
- Overrides:
equals
in classObject
- Parameters:
object
- the object to compare tothis
.- Returns:
true
if both objects are equal.- See Also:
-
hashCode
public int hashCode()Returns a hash value for this parameter.
-