Package javax.measure.test.quantity
Class TestQuantity<Q extends Quantity<Q>>
Object
TestQuantity<Q>
- All Implemented Interfaces:
Comparable<Quantity<Q>>,Quantity<Q>
- Direct Known Subclasses:
AreaQuantity,DistanceQuantity,TemperatureQuantity,TimeQuantity,VolumeQuantity
public abstract class TestQuantity<Q extends Quantity<Q>>
extends Object
implements Quantity<Q>, Comparable<Quantity<Q>>
- Since:
- 1.0
- Version:
- 2.0
- Author:
- Werner Keil
-
Nested Class Summary
Nested classes/interfaces inherited from interface Quantity
Quantity.Scale -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTestQuantity(Class<Q> type) protectedTestQuantity(Class<Q> type, Quantity.Scale scale) -
Method Summary
Modifier and TypeMethodDescriptionadd(TestQuantity<Q> dn, TestQuantity<Q> d1, TestQuantity<Q> d2, TestUnit<Q> au) intCompares this quantity to the specified Measurement quantity.booleaneq(TestQuantity<Q> d1) booleange(TestQuantity<Q> d1) getScale()getType()getUnit()getValue()booleangt(TestQuantity<Q> d1) booleanisEquivalentTo(Quantity<Q> that) booleanle(TestQuantity<Q> d1) booleanlt(TestQuantity<Q> d1) booleanne(TestQuantity<Q> d1) protected StringshowInUnits(TestUnit<?> u, int precision) subtract(TestQuantity<Q> dn, TestQuantity<Q> d1, TestQuantity<Q> d2, TestUnit<Q> au) toString()
-
Field Details
-
ONE
-
scalar
-
value
-
unit
-
-
Constructor Details
-
TestQuantity
-
TestQuantity
-
-
Method Details
-
getType
-
add
public TestQuantity<Q> add(TestQuantity<Q> dn, TestQuantity<Q> d1, TestQuantity<Q> d2, TestUnit<Q> au) -
subtract
public TestQuantity<Q> subtract(TestQuantity<Q> dn, TestQuantity<Q> d1, TestQuantity<Q> d2, TestUnit<Q> au) -
eq
-
ne
-
gt
-
lt
-
ge
-
le
-
toString
-
compareTo
Compares this quantity to the specified Measurement quantity. The default implementation compares theQuantity.getValue()of both this quantity and the specified Quantity stated in the same unit (this quantity'sunit).- Specified by:
compareToin interfaceComparable<Q extends Quantity<Q>>- Returns:
- a negative integer, zero, or a positive integer as this quantity is less than, equal to, or greater than the specified Quantity quantity.
-
showInUnits
-
getValue
-
getUnit
-
getScale
-
isEquivalentTo
- Specified by:
isEquivalentToin interfaceQuantity<Q extends Quantity<Q>>
-