Class VectorMeasure<Q extends Quantity>
- All Implemented Interfaces:
Serializable
,Comparable<Measurable<Q>>
,Measurable<Q>
This class represents a measurement vector of two or more dimensions.
For example:[code]
VectorMeasure
Subclasses may provide fixed dimensions specializations:[code]
class Velocity2D extends VectorMeasure
Measurement vectors may use compound units
:[code]
VectorMeasure
Instances of this class (and sub-classes) are immutable.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract double
doubleValue
(Unit<Q> unit) Returns the norm of this measurement vector stated in the specified unit.abstract VectorMeasure<Q>
Returns the measurement vector equivalent to this one but stated in the specified unit.toString()
Returns theString
representation of this measurement vector (for example[2.3 m/s, 5.6 m/s]
).static <Q extends Quantity>
VectorMeasure<Q>Returns a multi-dimensional measurement vector.static <Q extends Quantity>
VectorMeasure<Q>Returns a 3-dimensional measurement vector.static <Q extends Quantity>
VectorMeasure<Q>Returns a 2-dimensional measurement vector.
-
Constructor Details
-
VectorMeasure
protected VectorMeasure()Default constructor (for sub-classes).
-
-
Method Details
-
valueOf
Returns a 2-dimensional measurement vector.- Parameters:
x
- the first vector component value.y
- the second vector component value.unit
- the measurement unit.
-
valueOf
public static <Q extends Quantity> VectorMeasure<Q> valueOf(double x, double y, double z, Unit<Q> unit) Returns a 3-dimensional measurement vector.- Parameters:
x
- the first vector component value.y
- the second vector component value.z
- the third vector component value.unit
- the measurement unit.
-
valueOf
Returns a multi-dimensional measurement vector.- Parameters:
components
- the vector component values.unit
- the measurement unit.
-
to
Returns the measurement vector equivalent to this one but stated in the specified unit. -
doubleValue
Returns the norm of this measurement vector stated in the specified unit.- Specified by:
doubleValue
in interfaceMeasurable<Q extends Quantity>
- Specified by:
doubleValue
in classMeasure<double[],
Q extends Quantity> - Parameters:
unit
- the unit in which the norm is stated.- Returns:
|this|
-
toString
Returns theString
representation of this measurement vector (for example[2.3 m/s, 5.6 m/s]
).
-