- All Superinterfaces:
GeneralParameterValue
ParameterValueGroup
, if those instances contain different values
of one or more ParameterValue
s which suitably distinguish among those groups.
The methods adapted from the ISO 19111 standard are getDescriptor()
and values()
.
Other methods (except clone()
) are convenience methods:
parameter(String)
searches for a single parameter value of the given name.groups(String)
searches for all groups of the given name.addGroup(String)
for creating a new subgroup and adding it to the list of subgroups.
Design note:
There is noparameters(String)
method returning a list of parameter values
because the ISO 19111 standard fixes the ParameterValue
maximum occurrence to 1.- Since:
- 1.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionCreates a new subgroup of the specified name, and adds it to the list of subgroups.clone()
Returns a copy of this group of parameter values.Returns the abstract definition of this group of parameters.Returns all subgroups with the specified name.Returns the value in this group for the specified identifier code.values()
Returns all values in this group.
-
Method Details
-
getDescriptor
@UML(identifier="group", obligation=MANDATORY, specification=ISO_19111) ParameterDescriptorGroup getDescriptor()Returns the abstract definition of this group of parameters.- Specified by:
getDescriptor
in interfaceGeneralParameterValue
- Returns:
- the abstract definition of this group of parameters.
Departure from OGC/ISO standard in the name
The ISO name was "group
". GeoAPI uses "descriptor
" instead in order to override thegetDescriptor()
generic method provided in the parent interface. In addition the "descriptor" name makes more apparent that this method returns an abstract definition of parameters - not their actual values - and is consistent with usage in other Java libraries like the Java Advanced Imaging library. -
values
@UML(identifier="parameterValue", obligation=MANDATORY, specification=ISO_19111) List<GeneralParameterValue> values()Returns all values in this group. The returned list may or may not be unmodifiable; this is implementation-dependent. However, if some aspects of this list are modifiable, then any modification shall be reflected back into thisParameterValueGroup
. More specifically:- If the list supports the
add
operation, then it should ensure that the added general parameter value is valid and can be added to this group. AnInvalidParameterCardinalityException
(or any other appropriate exception) shall be thrown if it is not the case. - The list may also supports the
remove
operation as a way to remove parameter created by theparameter(String)
method.
- Returns:
- the values in this group.
- If the list supports the
-
parameter
Returns the value in this group for the specified identifier code. This method performs the following choice:- If this group contains a parameter value of the given name, then that parameter is returned.
- Otherwise if a descriptor of the given name
exists, then a new
ParameterValue
instance is created, added to this group and returned. - Otherwise a
ParameterNotFoundException
is thrown.
This convenience method provides a way to get and set parameter values by name. For example, the following idiom fetches a floating point value for the
"False northing"
parameter:
The following idiom sets a floating point value for thedouble northing = parameter("False northing").doubleValue();
"False easting"
parameter:
This method does not search recursively in subgroups. This is because more than one subgroup may exist for the same descriptor. The user have to query all subgroups and select explicitly the appropriate one to use.parameter("False easting").setValue(500000.0);
- Parameters:
name
- the case insensitive identifier code of the parameter to search for.- Returns:
- the parameter value for the given identifier code.
- Throws:
ParameterNotFoundException
- if there is no parameter value for the given identifier code.
Convenience extension to OGC/ISO standard
This method is not part of the ISO specification. It has been added in an attempt to make this interface easier to use. -
groups
Returns all subgroups with the specified name. Groups are listed in the order they were added by calls toaddGroup(String)
.This method does not create new groups: if the requested group is optional (i.e.
minimumOccurs == 0
) and no value were defined previously, then this method returns an empty list.- Parameters:
name
- the case insensitive identifier code of the parameter group to search for.- Returns:
- the list of all parameter group for the given identifier code, in insertion order.
- Throws:
ParameterNotFoundException
- if no descriptor was found for the given name.
Convenience extension to OGC/ISO standard
This method is not part of the ISO specification. It has been added for ease of use. -
addGroup
ParameterValueGroup addGroup(String name) throws ParameterNotFoundException, InvalidParameterCardinalityException, IllegalStateException Creates a new subgroup of the specified name, and adds it to the list of subgroups. The specified name shall be the identifier code of a descriptor group which is a child of this group.There is no
removeGroup(String)
method. To remove a group, users can inspect thegroups(String)
orvalues()
list, decide which occurrences to remove if there is many of them for the same name, and whether to iterate recursively into sub-groups or not.- Parameters:
name
- the case insensitive identifier code of the parameter group to create.- Returns:
- a newly created parameter group for the given identifier code.
- Throws:
ParameterNotFoundException
- if no descriptor was found for the given name.InvalidParameterCardinalityException
- if this parameter group already contains the maximum number of occurences of subgroups of the given name.IllegalStateException
- if the group cannot be added for another reason.
Convenience extension to OGC/ISO standard
This method is not part of the ISO specification. It has been added for ease of use. -
clone
Returns a copy of this group of parameter values. Included parameter values and subgroups are cloned recursively.- Specified by:
clone
in interfaceGeneralParameterValue
- Returns:
- a copy of this group of parameter values.
-