\n\n\n\nVectorMeasure\n\n\n\n\n\n\n\n\n\n\n\n
\n\n\n\n\n
\n
\n
\n\n\n\n
\n
javax.measure
\n

## Class VectorMeasure<Q extends Quantity>

\n
\n
\n
\n
\n
\n
• \n
\n
All Implemented Interfaces:
\n
Serializable, Comparable<Measurable<Q>>, Measurable<Q>
\n
\n
\n
\n
`public abstract class VectorMeasure<Q extends Quantity>\nextends Measure<double[],Q>`
\n

This class represents a measurement vector of two or more dimensions.\n For example:

``\n         VectorMeasure<Length> dimension = VectorMeasure.valueOf(12.0, 30.0, 40.0, MILLIMETER);\n         VectorMeasure<Velocity> v2d = VectorMeasure.valueOf(-2.2, -3.0, KNOTS);\n         VectorMeasure<ElectricCurrent> c2d = VectorMeasure.valueOf(-7.3, 3.5, NANOAMPERE);\n     ``
\n

\n \n

Subclasses may provide fixed dimensions specializations:

``\n         class Velocity2D extends VectorMeasure<Velocity> {\n              public Velocity2D(double x, double y, Unit<Velocity> unit) {\n                  ...\n              }\n         }\n     ``

\n \n

Measurement vectors may use `compound units`:

``\n     VectorMeasure<Angle> latLong = VectorMeasure.valueOf(12.345, 22.23, DEGREE_ANGLE);\n     Unit<Angle> HOUR_MINUTE_SECOND_ANGLE = DEGREE_ANGLE.compound(MINUTE_ANGLE).compound(SECOND_ANGLE);\n     System.out.println(latLong.to(HOUR_MINUTE_SECOND_ANGLE));\n     \n     > [12\xc2\xb019\'42", 22\xc2\xb012\'48"] ``

\n \n

Instances of this class (and sub-classes) are immutable.

\n
Serialized Form
\n
• \n
\n
\n
\n
\n
• \n\n
\n
• \n\n\n

### Method Summary

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Methods
Modifier and TypeMethod and Description
`abstract double``doubleValue(Unit<Q> unit)`\n
Returns the norm of this measurement vector stated in the specified\n unit.
\n
`abstract VectorMeasure<Q>``to(Unit<Q> unit)`\n
Returns the measurement vector equivalent to this one but stated in the \n specified unit.
\n
`String``toString()`\n
Returns the `String` representation of this measurement\n vector (for example `[2.3 m/s, 5.6 m/s]`).
\n
`static <Q extends Quantity> VectorMeasure<Q>``valueOf(double[] components,\n Unit<Q> unit)`\n
Returns a multi-dimensional measurement vector.
\n
`static <Q extends Quantity> VectorMeasure<Q>``valueOf(double x,\n double y,\n double z,\n Unit<Q> unit)`\n
Returns a 3-dimensional measurement vector.
\n
`static <Q extends Quantity> VectorMeasure<Q>``valueOf(double x,\n double y,\n Unit<Q> unit)`\n
Returns a 2-dimensional measurement vector.
\n
\n
\n
• \n\n\n

### Methods inherited from class javax.measure.Measure

\n`compareTo, equals, floatValue, getUnit, getValue, hashCode, intValue, longValue, valueOf, valueOf, valueOf, valueOf, valueOf, valueOf`
• \n
\n
\n
• \n\n\n

### Methods inherited from class java.lang.Object

\n`getClass, notify, notifyAll, wait, wait, wait`
• \n
\n
• \n
\n
• \n
\n
\n
\n
\n
• \n\n
\n
• \n\n\n

### Method Detail

\n\n\n\n
\n
• \n

#### valueOf

\n
`public static <Q extends Quantity> VectorMeasure<Q> valueOf(double x,\n                                            double y,\n                                            Unit<Q> unit)`
\n
Returns a 2-dimensional measurement vector.
\n
Parameters:
`x` - the first vector component value.
`y` - the second vector component value.
`unit` - the measurement unit.
\n
• \n
\n\n\n\n
\n
• \n

#### valueOf

\n
`public static <Q extends Quantity> VectorMeasure<Q> valueOf(double x,\n                                            double y,\n                                            double z,\n                                            Unit<Q> unit)`
\n
Returns a 3-dimensional measurement vector.
\n
Parameters:
`x` - the first vector component value.
`y` - the second vector component value.
`z` - the third vector component value.
`unit` - the measurement unit.
\n
• \n
\n\n\n\n
\n
• \n

#### valueOf

\n
`public static <Q extends Quantity> VectorMeasure<Q> valueOf(double[] components,\n                                            Unit<Q> unit)`
\n
Returns a multi-dimensional measurement vector.
\n
Parameters:
`components` - the vector component values.
`unit` - the measurement unit.
\n
• \n
\n\n\n\n
\n
• \n

#### to

\n
`public abstract VectorMeasure<Q> to(Unit<Q> unit)`
\n
Returns the measurement vector equivalent to this one but stated in the \n specified unit.
\n
\n
Specified by:
\n
`to` in class `Measure<double[],Q extends Quantity>`
\n
Parameters:
`unit` - the new measurement unit.
\n
Returns:
the vector measure stated in the specified unit.
\n
• \n
\n\n\n\n
\n
• \n

#### doubleValue

\n
`public abstract double doubleValue(Unit<Q> unit)`
\n
Returns the norm of this measurement vector stated in the specified\n unit.
\n
\n
Specified by:
\n
`doubleValue` in interface `Measurable<Q extends Quantity>`
\n
Specified by:
\n
`doubleValue` in class `Measure<double[],Q extends Quantity>`
\n
Parameters:
`unit` - the unit in which the norm is stated.
\n
Returns:
`|this|`
\n
• \n
\n\n\n\n
\n
• \n

#### toString

\n
`public String toString()`
\n
Returns the `String` representation of this measurement\n vector (for example `[2.3 m/s, 5.6 m/s]`).
\n
\n
Overrides:
\n
`toString` in class `Measure<double[],Q extends Quantity>`
\n
Returns:
the textual representation of the measurement vector.
\n
• \n
\n
• \n
\n
• \n
\n
\n
\n\n\n
\n\n\n\n\n
\n
\n
\n\n\n