- Type Parameters:
T- The type of parameter values.
- All Superinterfaces:
GeneralParameterValue
@UML(identifier="CC_ParameterValue",
specification=ISO_19111)
public interface ParameterValue<T>
extends GeneralParameterValue
A parameter value used by an operation method. Most parameter values are numeric and can be
obtained by the
intValue() or doubleValue() methods. But other types of
parameter values are possible and can be handled by the more generic getValue() and
setValue(Object) methods. The type and constraints on parameter values are given
by the descriptor.
Instances of ParameterValue are created by the ParameterDescriptor.createValue()
method.
- Since:
- 1.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the boolean value of an operation parameter A boolean value does not have an associated unit of measure.clone()Returns a copy of this parameter value.doubleReturns the numeric value of the coordinate operation parameter with its associated unit of measure.doubledoubleValue(Unit<?> unit) Returns the numeric value of the coordinate operation parameter in the specified unit of measure.double[]Returns an ordered sequence of two or more numeric values of an operation parameter list, where each value has the same associated unit of measure.double[]doubleValueList(Unit<?> unit) Returns an ordered sequence of numeric values in the specified unit of measure.Returns the abstract definition of this parameter value.Unit<?>getUnit()Returns the unit of measure of the parameter value.getValue()Returns the parameter value as an object.intintValue()Returns the positive integer value of an operation parameter, usually used for a count.int[]Returns an ordered sequence of two or more integer values of an operation parameter list, usually used for counts.voidsetValue(boolean value) Set the parameter value as a boolean.voidsetValue(double value) Sets the parameter value as a floating point.voidsetValue(double[] values, Unit<?> unit) Sets the parameter value as an array of floating point and their associated unit.voidsetValue(double value, Unit<?> unit) Sets the parameter value as a floating point and its associated unit.voidsetValue(int value) Set the parameter value as an integer.voidSet the parameter value as an object.Returns the string value of an operation parameter.Returns a reference to a file or a part of a file containing one or more parameter values.
-
Method Details
-
getDescriptor
ParameterDescriptor<T> getDescriptor()Returns the abstract definition of this parameter value.- Specified by:
getDescriptorin interfaceGeneralParameterValue- Returns:
- The abstract definition of this parameter value.
-
getUnit
Unit<?> getUnit()Returns the unit of measure of the parameter value. If the parameter value has no unit (for example because it is aStringtype), then this method returnsnull. Note that "no unit" doesn't means "dimensionless".- Returns:
- The unit of measure of the parameter value.
- See Also:
-
doubleValue
Returns the numeric value of the coordinate operation parameter in the specified unit of measure. This convenience method applies unit conversion on the fly as needed.- Parameters:
unit- The unit of measure for the value to be returned.- Returns:
- The numeric value represented by this parameter after conversion to type
doubleand conversion tounit. - Throws:
IllegalArgumentException- if the specified unit is invalid for this parameter.InvalidParameterTypeException- if the value is not a numeric type.IllegalStateException- if the value cannot be returned for another reason.- See Also:
-
doubleValue
Returns the numeric value of the coordinate operation parameter with its associated unit of measure.- Returns:
- The numeric value represented by this parameter after conversion to type
double. - Throws:
InvalidParameterTypeException- if the value is not a numeric type.IllegalStateException- if the value cannot be returned for another reason.- See Also:
- Departure from OGC/ISO abstract specification:
Change of name without change in functionality
Renamed the method from "value" to "doubleValue" for consistency withNumber.doubleValue()and the other "*Value" methods defined in this interface.- Unit:
- Measure
-
intValue
@UML(identifier="integerValue", obligation=CONDITIONAL, specification=ISO_19111) int intValue() throws IllegalStateExceptionReturns the positive integer value of an operation parameter, usually used for a count. An integer value does not have an associated unit of measure.- Returns:
- The numeric value represented by this parameter after conversion to type
int. - Throws:
InvalidParameterTypeException- if the value is not an integer type.IllegalStateException- if the value cannot be returned for another reason.- See Also:
- Departure from OGC/ISO abstract specification:
Change of name without change in functionality
Renamed the method from "integerValue" to "intValue" for consistency withNumber.intValue()and theintJava primitive type.
-
booleanValue
@UML(identifier="booleanValue", obligation=CONDITIONAL, specification=ISO_19111) boolean booleanValue() throws IllegalStateExceptionReturns the boolean value of an operation parameter A boolean value does not have an associated unit of measure.- Returns:
- The boolean value represented by this parameter.
- Throws:
InvalidParameterTypeException- if the value is not a boolean type.IllegalStateException- if the value cannot be returned for another reason.- See Also:
-
stringValue
@UML(identifier="stringValue", obligation=CONDITIONAL, specification=ISO_19111) String stringValue() throws IllegalStateExceptionReturns the string value of an operation parameter. A string value does not have an associated unit of measure.- Returns:
- The string value represented by this parameter.
- Throws:
InvalidParameterTypeException- if the value is not a string.IllegalStateException- if the value cannot be returned for another reason.- See Also:
-
doubleValueList
Returns an ordered sequence of numeric values in the specified unit of measure. This convenience method applies unit conversions on the fly as needed.- Parameters:
unit- The unit of measure for the value to be returned.- Returns:
- The sequence of values represented by this parameter after conversion to type
doubleand conversion tounit. - Throws:
IllegalArgumentException- if the specified unit is invalid for this parameter.InvalidParameterTypeException- if the value is not an array ofdoubles.IllegalStateException- if the value cannot be returned for another reason.- See Also:
-
doubleValueList
@UML(identifier="valueList", obligation=CONDITIONAL, specification=ISO_19111) double[] doubleValueList() throws IllegalStateExceptionReturns an ordered sequence of two or more numeric values of an operation parameter list, where each value has the same associated unit of measure.- Returns:
- The sequence of values represented by this parameter.
- Throws:
InvalidParameterTypeException- if the value is not an array ofdoubles.IllegalStateException- if the value cannot be returned for another reason.- See Also:
- Departure from OGC/ISO abstract specification:
Change of name without change in functionality
Renamed the method from "valueList" to "doubleValueList" both for consistency withdoubleValue()and also because, likedoubleValue(), this method returns an array ofdoublevalues rather than aMeasureobject.- Unit:
- Measure
-
intValueList
@UML(identifier="integerValueList", obligation=CONDITIONAL, specification=ISO_19111) int[] intValueList() throws IllegalStateExceptionReturns an ordered sequence of two or more integer values of an operation parameter list, usually used for counts. These integer values do not have an associated unit of measure.- Returns:
- The sequence of values represented by this parameter.
- Throws:
InvalidParameterTypeException- if the value is not an array ofints.IllegalStateException- if the value cannot be returned for another reason.- See Also:
- Departure from OGC/ISO abstract specification:
Change of name without change in functionality
Renamed the attribute from "integerValueList" to "intValueList" for consistency withintValue().
-
valueFile
@UML(identifier="valueFile", obligation=CONDITIONAL, specification=ISO_19111) URI valueFile() throws IllegalStateExceptionReturns a reference to a file or a part of a file containing one or more parameter values. When referencing a part of a file, that file must contain multiple identified parts, such as an XML encoded document. Furthermore, the referenced file or part of a file can reference another part of the same or different files, as allowed in XML documents.- Returns:
- The reference to a file containing parameter values.
- Throws:
InvalidParameterTypeException- if the value is not a reference to a file or an URI.IllegalStateException- if the value cannot be returned for another reason.- See Also:
-
getValue
Returns the parameter value as an object. The object type is typically aDouble,Integer,Boolean,String,URI,double[]orint[]. If no value has been set, then this method returns the default value (which may be null).- Returns:
- The parameter value as an object, or
nullif no value has been set and there is no default value. - See Also:
-
setValue
Sets the parameter value as an array of floating point and their associated unit.- Parameters:
values- The parameter values.unit- The unit for the specified value.- Throws:
InvalidParameterValueException- if the floating point type is inappropriate for this parameter, or if the value is illegal for some other reason (for example a value out of range).
-
setValue
Sets the parameter value as a floating point and its associated unit.- Parameters:
value- The parameter value.unit- The unit for the specified value.- Throws:
InvalidParameterValueException- if the floating point type is inappropriate for this parameter, or if the value is illegal for some other reason (for example a value out of range).- See Also:
-
setValue
Sets the parameter value as a floating point.- Parameters:
value- The parameter value.- Throws:
InvalidParameterValueException- if the floating point type is inappropriate for this parameter, or if the value is illegal for some other reason (for example a value out of range).- See Also:
-
setValue
Set the parameter value as an integer.- Parameters:
value- The parameter value.- Throws:
InvalidParameterValueException- if the integer type is inappropriate for this parameter, or if the value is illegal for some other reason (for example a value out of range).- See Also:
-
setValue
Set the parameter value as a boolean.- Parameters:
value- The parameter value.- Throws:
InvalidParameterValueException- if the boolean type is inappropriate for this parameter.- See Also:
-
setValue
Set the parameter value as an object. The object type is typically aDouble,Integer,Boolean,String,URI,double[]orint[].The argument is not restricted to the parameterized type
Tbecause the type is typically unknown (as ingroup.parameter("name").setValue(value)) and because some implementations may choose to convert a wider range of types.- Parameters:
value- The parameter value.- Throws:
InvalidParameterValueException- if the type ofvalueis inappropriate for this parameter, or if the value is illegal for some other reason (for example the value is numeric and out of range).- See Also:
-
clone
ParameterValue<T> clone()Returns a copy of this parameter value.- Specified by:
clonein interfaceGeneralParameterValue- Returns:
- A copy of this parameter value.
-