Class ParameterVector<Q extends javax.measure.quantity.Quantity>

    • Field Detail

      • X

        public static final int X
        Constant used to identify the X (0) coordinate in the vector.
        See Also:
        Constant Field Values
      • Y

        public static final int Y
        Constant used to identify the Y (1) coordinate in the vector.
        See Also:
        Constant Field Values
      • Z

        public static final int Z
        Constant used to identify the Z (2) coordinate in the vector.
        See Also:
        Constant Field Values
    • Method Detail

      • valueOf

        public static <Q extends javax.measure.quantity.Quantity> ParameterVector<Q> valueOf​(double x,
                                                                                             double y,
                                                                                             javax.measure.unit.Unit<Q> unit)
        Returns a 2D ParameterVector instance holding the specified double values stated in the specified units.
        Parameters:
        x - the x value stated in the specified unit.
        y - the y value stated in the specified unit.
        unit - the unit in which the coordinates are stated.
        Returns:
        the vector having the specified values.
      • valueOf

        public static <Q extends javax.measure.quantity.Quantity> ParameterVector<Q> valueOf​(double x,
                                                                                             double y,
                                                                                             double z,
                                                                                             javax.measure.unit.Unit<Q> unit)
        Returns a ParameterVector instance holding the specified double values stated in the specified units.
        Parameters:
        x - the x value stated in the specified unit.
        y - the y value stated in the specified unit.
        z - the z value stated in the specified unit.
        unit - the unit in which the coordinates are stated.
        Returns:
        the vector having the specified values.
      • valueOf

        public static <Q extends javax.measure.quantity.Quantity> ParameterVector<Q> valueOf​(javax.measure.unit.Unit<Q> unit,
                                                                                             double... values)
        Returns a ParameterVector instance holding the specified double values stated in the specified units.
        Parameters:
        unit - the unit in which the coordinates are stated.
        values - A list of values to store in the vector.
        Returns:
        the vector having the specified values.
      • valueOf

        public static <Q extends javax.measure.quantity.Quantity> ParameterVector<Q> valueOf​(Parameter<Q> x,
                                                                                             Parameter<Q> y,
                                                                                             Parameter<Q> z)
        Returns a ParameterVector instance holding the specified Parameter values. All the values are converted to the same units as the x value.
        Parameters:
        x - the x value.
        y - the y value.
        z - the z value.
        Returns:
        the vector having the specified values in the units of x.
      • valueOf

        public static <Q extends javax.measure.quantity.Quantity> ParameterVector<Q> valueOf​(java.util.List<Parameter<Q>> values)
        Returns a ParameterVector instance holding the specified Parameter values. All the values are converted to the same units as the first value.
        Parameters:
        values - A list of values to store in the vector.
        Returns:
        the vector having the specified values in the units of x.
      • valueOf

        public static <Q extends javax.measure.quantity.Quantity> ParameterVector<Q> valueOf​(Parameter<Q>... values)
        Returns a ParameterVector instance holding the specified Parameter values. All the values are converted to the same units as the first value.
        Parameters:
        values - A list of values to store in the vector.
        Returns:
        the vector having the specified values in the units of x.
      • valueOf

        public static <Q extends javax.measure.quantity.Quantity> ParameterVector<Q> valueOf​(Vector<Float64> vector,
                                                                                             javax.measure.unit.Unit<Q> unit)
        Returns a ParameterVector instance containing the specified vector of Float64 values stated in the specified units.
        Parameters:
        vector - the vector of Float64 values stated in the specified unit.
        unit - the unit in which the coordinates are stated.
        Returns:
        the vector having the specified values.
      • valueOf

        public static <Q extends javax.measure.quantity.Quantity> ParameterVector<Q> valueOf​(Vector<Parameter<Q>> vector)
        Returns a ParameterVector instance containing the specified vector of Parameter values with compatible units. All the values are converted to the same units as the 1st value.
        Parameters:
        vector - the vector of Parameter values stated in the specified unit.
        Returns:
        the vector having the specified values.
      • fromVector3D

        public ParameterVector<QfromVector3D​(Vector3D<Q> vector)
        Return the specified Vector3D object as a ParameterVector instance.
        Specified by:
        fromVector3D in class AbstractParamVector<Q extends javax.measure.quantity.Quantity,​ParameterVector<Q extends javax.measure.quantity.Quantity>>
        Parameters:
        vector - The Vector3D object to be converted to a ParameterVector.
        Returns:
        A ParameterVector instance that is equivalent to the supplied Vector3D object.
      • getDimension

        public int getDimension()
        Returns the number of elements held by this vector.
        Specified by:
        getDimension in class Vector<Parameter<Q extends javax.measure.quantity.Quantity>>
        Returns:
        this vector dimension.
      • get

        public Parameter<Qget​(int i)
        Returns the value of a Parameter from this vector.
        Specified by:
        get in class Vector<Parameter<Q extends javax.measure.quantity.Quantity>>
        Parameters:
        i - the dimension index.
        Returns:
        the value of the parameter at i.
        Throws:
        java.lang.IndexOutOfBoundsException - (i < 0) || (i >= dimension())
      • getValue

        public double getValue​(int i)
        Returns the value of the Parameter in this vector as a double, stated in this vector's unit.
        Overrides:
        getValue in class AbstractParamVector<Q extends javax.measure.quantity.Quantity,​ParameterVector<Q extends javax.measure.quantity.Quantity>>
        Parameters:
        i - the dimension index.
        Returns:
        the value of the Parameter at i.
        Throws:
        java.lang.IndexOutOfBoundsException - (i < 0) || (i >= dimension())
      • plus

        public ParameterVector<Qplus​(Vector<Parameter<Q>> that)
        Returns the sum of this vector with the one specified. The unit of the output vector will be the units of this vector.
        Specified by:
        plus in interface GroupAdditive<Q extends javax.measure.quantity.Quantity>
        Specified by:
        plus in class Vector<Parameter<Q extends javax.measure.quantity.Quantity>>
        Parameters:
        that - the vector to be added.
        Returns:
        this + that.
        Throws:
        DimensionException - if vector dimensions are different.
        javax.measure.converter.ConversionException - if the input vector is not in units consistent with this vector.
      • plus

        public ParameterVector<Qplus​(Parameter<Q> that)
        Returns the sum of this vector with the parameter specified. The input parameter is added to each component of this vector. The unit of the output vector will be the units of this vector.
        Specified by:
        plus in class AbstractParamVector<Q extends javax.measure.quantity.Quantity,​ParameterVector<Q extends javax.measure.quantity.Quantity>>
        Parameters:
        that - the parameter to be added to each element of this vector.
        Returns:
        this + that.
      • minus

        public ParameterVector<Qminus​(Vector<Parameter<Q>> that)
        Returns the difference between this vector and the one specified. The unit of the output vector will be the units of this vector.
        Overrides:
        minus in class Vector<Parameter<Q extends javax.measure.quantity.Quantity>>
        Parameters:
        that - the vector to be subtracted.
        Returns:
        this - that.
        Throws:
        DimensionException - if vector dimensions are different.
        javax.measure.converter.ConversionException - if the input vector is not in units consistent with this vector.
      • minus

        public ParameterVector<Qminus​(Parameter<Q> that)
        Subtracts the supplied Parameter from each element of this vector and returns the result. The unit of the output vector will be the units of this vector.
        Specified by:
        minus in class AbstractParamVector<Q extends javax.measure.quantity.Quantity,​ParameterVector<Q extends javax.measure.quantity.Quantity>>
        Parameters:
        that - the Parameter to be subtracted from each element of this vector.
        Returns:
        this - that.
      • times

        public ParameterVector<Qtimes​(double k)
        Returns the product of this vector with the specified coefficient.
        Specified by:
        times in class AbstractParamVector<Q extends javax.measure.quantity.Quantity,​ParameterVector<Q extends javax.measure.quantity.Quantity>>
        Parameters:
        k - the coefficient multiplier.
        Returns:
        this times k
      • timesEBE

        public ParameterVector timesEBE​(Vector that)
        Returns the element-by-element product of this vector with the one specified.
        Parameters:
        that - the vector multiplier.
        Returns:
        this .* that
        Throws:
        DimensionException - if this.dimension() != that.dimension()
      • divide

        public ParameterVector<?> divide​(Parameter<?> that)
        Returns this vector with each element divided by the specified divisor.
        Parameters:
        that - the divisor.
        Returns:
        this / that.
      • copy

        public ParameterVector<Qcopy()
        Returns a copy of this vector allocated by the calling thread (possibly on the stack).
        Specified by:
        copy in interface javolution.lang.ValueType
        Specified by:
        copy in class Vector<Parameter<Q extends javax.measure.quantity.Quantity>>
        Returns:
        an identical and independent copy of this vector.
      • getUnit

        public javax.measure.unit.Unit<QgetUnit()
        Returns the unit in which the values in this vector are stated in.
        Specified by:
        getUnit in class AbstractParamVector<Q extends javax.measure.quantity.Quantity,​ParameterVector<Q extends javax.measure.quantity.Quantity>>
        Returns:
        The unit in which the values in this vector are stated
      • to

        public <R extends javax.measure.quantity.Quantity> ParameterVector<R> to​(javax.measure.unit.Unit<R> unit)
        Returns the equivalent to this vector but stated in the specified unit.
        Specified by:
        to in class AbstractParamVector<Q extends javax.measure.quantity.Quantity,​ParameterVector<Q extends javax.measure.quantity.Quantity>>
        Type Parameters:
        R - The Quantity (unit type) of the vector being output.
        Parameters:
        unit - the unit of the vector to be returned.
        Returns:
        a vector equivalent to this vector but stated in the specified unit.
        Throws:
        javax.measure.converter.ConversionException - if the current model does not allows for conversion to the specified unit.
      • asType

        public <T extends javax.measure.quantity.Quantity> ParameterVector<T> asType​(java.lang.Class<T> type)
                                                                              throws java.lang.ClassCastException
        Casts this ParameterVector to a parameterized unit of specified nature or throw a ClassCastException if the dimension of the specified quantity and this parameter's unit dimension do not match.
        Parameters:
        type - the quantity class identifying the nature of the unit.
        Returns:
        this ParameterVector parameterized with the specified type.
        Throws:
        java.lang.ClassCastException - if the dimension of this parameter's unit is different from the specified quantity dimension.
        java.lang.UnsupportedOperationException - if the specified quantity class does not have a public static field named "UNIT" holding the standard unit for the quantity.
      • equals

        public boolean equals​(java.lang.Object obj)
        Compares this ParameterVector against the specified object for strict equality (same values and same units).
        Overrides:
        equals in class Vector<Parameter<Q extends javax.measure.quantity.Quantity>>
        Parameters:
        obj - the object to compare with.
        Returns:
        true if this vector is identical to that vector; false otherwise.
      • main

        public static void main​(java.lang.String[] args)
        Tests the methods in this class.