Interface ParameterValue<T>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean booleanValue()
      Returns the boolean value of an operation parameter A boolean value does not have an associated unit of measure.
      ParameterValue clone()
      Returns a copy of this parameter value.
      double doubleValue()
      Returns the numeric value of the coordinate operation parameter with its associated unit of measure.
      double doubleValue​(Unit<?> unit)
      Returns the numeric value of the coordinate operation parameter in the specified unit of measure.
      double[] doubleValueList()
      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.
      ParameterDescriptor<T> getDescriptor()
      Returns the abstract definition of this parameter value.
      Unit<?> getUnit()
      Returns the unit of measure of the parameter value.
      T getValue()
      Returns the parameter value as an object.
      int intValue()
      Returns the positive integer value of an operation parameter, usually used for a count.
      int[] intValueList()
      Returns an ordered sequence of two or more integer values of an operation parameter list, usually used for counts.
      void setValue​(boolean value)
      Set the parameter value as a boolean.
      void setValue​(double value)
      Sets the parameter value as a floating point.
      void setValue​(double[] values, Unit<?> unit)
      Sets the parameter value as an array of floating point and their associated unit.
      void setValue​(double value, Unit<?> unit)
      Sets the parameter value as a floating point and its associated unit.
      void setValue​(int value)
      Set the parameter value as an integer.
      void setValue​(Object value)
      Set the parameter value as an object.
      String stringValue()
      Returns the string value of an operation parameter.
      URI valueFile()
      Returns a reference to a file or a part of a file containing one or more parameter values.
    • Method Detail

      • doubleValue

        double doubleValue​(Unit<?> unit)
                    throws InvalidParameterTypeException
        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 double and conversion to unit.
        Throws:
        InvalidParameterTypeException - if the value is not a numeric type.
        IllegalArgumentException - if the specified unit is invalid for this parameter.
        See Also:
        getUnit(), setValue(double,Unit), doubleValueList(Unit)
      • doubleValueList

        double[] doubleValueList​(Unit<?> unit)
                          throws InvalidParameterTypeException
        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 double and conversion to unit.
        Throws:
        InvalidParameterTypeException - if the value is not an array of doubles.
        IllegalArgumentException - if the specified unit is invalid for this parameter.
        See Also:
        getUnit(), setValue(double[],Unit), doubleValue(Unit)
      • intValueList

        int[] intValueList()
                    throws InvalidParameterTypeException
        Returns 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 of ints.
        See Also:
        setValue(Object), intValue()
      • valueFile

        URI valueFile()
               throws InvalidParameterTypeException
        Returns 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.
        See Also:
        getValue(), setValue(Object)
      • getValue

        T getValue()
        Returns the parameter value as an object. The object type is typically a Double, Integer, Boolean, String, URI, double[] or int[].
        Returns:
        The parameter value as an object.
        See Also:
        setValue(Object)
      • setValue

        void setValue​(double[] values,
                      Unit<?> unit)
               throws InvalidParameterValueException
        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

        void setValue​(double value,
                      Unit<?> unit)
               throws InvalidParameterValueException
        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(double), doubleValue(Unit)
      • setValue

        void setValue​(int value)
               throws InvalidParameterValueException
        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:
        intValue()
      • setValue

        void setValue​(Object value)
               throws InvalidParameterValueException
        Set the parameter value as an object. The object type is typically a Double, Integer, Boolean, String, URI, double[] or int[].

        The argument is not restricted to the parameterized type T because the type is typically unknown (as in group.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 of value is 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:
        getValue()