Class AnnotatedUnit<Q extends javax.measure.Quantity<Q>>
java.lang.Object
tech.units.indriya.AbstractUnit<Q>
tech.units.indriya.unit.AnnotatedUnit<Q>
- Type Parameters:
Q- The type of the quantity measured by this unit.
- All Implemented Interfaces:
Serializable, Comparable<javax.measure.Unit<Q>>, javax.measure.Unit<Q>, ComparableUnit<Q>
This class represents an annotated unit.
Instances of this class are created through the AbstractUnit.annotate(String) method.
- Since:
- 1.0
- Version:
- 1.3.2, Dezember 27, 2017
- Author:
- Jean-Marie Dautelle, Werner Keil
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractUnit
AbstractUnit.Equalizer -
Field Summary
Fields inherited from class AbstractUnit
name, ONE, SYMBOL_TO_UNIT -
Constructor Summary
ConstructorsConstructorDescriptionAnnotatedUnit(AbstractUnit<Q> actualUnit, String annotation) Creates an annotated unit equivalent to the specified unit. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the actual unit of this annotated unit (never an annotated unit itself).Returns the annotation of this annotated unit.javax.measure.Dimensionjavax.measure.UnitConverterReturns the converter from this unit to its unscaledunit.invalid reference
System UnitinthashCode()javax.measure.Unit<Q> Returns the unscaledunit from which this unit is derived.invalid reference
SIMethods inherited from class AbstractUnit
alternate, annotate, asType, compareTo, divide, divide, divide, getActualType, getConverterTo, getConverterToAny, getName, getSystemUnit, inverse, isCompatible, isEquivalentOf, isSystemUnit, multiply, multiply, multiply, parse, pow, prefix, root, setName, setSymbol, shift, toString, transform
-
Constructor Details
-
AnnotatedUnit
Creates an annotated unit equivalent to the specified unit.- Parameters:
actualUnit- the unit to be annotated.annotation- the annotation.
-
-
Method Details
-
getActualUnit
Returns the actual unit of this annotated unit (never an annotated unit itself).- Returns:
- the actual unit.
-
getAnnotation
Returns the annotation of this annotated unit.- Returns:
- the annotation.
-
getSymbol
-
getBaseUnits
- Specified by:
getBaseUnitsin interfacejavax.measure.Unit<Q extends javax.measure.Quantity<Q>>- Specified by:
getBaseUnitsin classAbstractUnit<Q extends javax.measure.Quantity<Q>>
-
toSystemUnit
Description copied from class:AbstractUnitReturns the unscaledunit from which this unit is derived. The SI unit can be be used to identify a quantity given the unit. For example:invalid reference
SIstatic boolean isAngularVelocity(AbstractUnitinvalid input: '<'?> unit) { return unit.toSystemUnit().equals(RADIAN.divide(SECOND)); } assert(REVOLUTION.divide(MINUTE).isAngularVelocity()); // Returns true.- Specified by:
toSystemUnitin classAbstractUnit<Q extends javax.measure.Quantity<Q>>- Returns:
- the unscaled metric unit from which this unit is derived.
-
getDimension
- Specified by:
getDimensionin interfacejavax.measure.Unit<Q extends javax.measure.Quantity<Q>>- Specified by:
getDimensionin classAbstractUnit<Q extends javax.measure.Quantity<Q>>
-
getSystemConverter
Description copied from class:AbstractUnitReturns the converter from this unit to its unscaledunit.invalid reference
System Unit- Specified by:
getSystemConverterin classAbstractUnit<Q extends javax.measure.Quantity<Q>>- Returns:
getConverterTo(this.toSystemUnit())- See Also:
-
hashCode
- Specified by:
hashCodein classAbstractUnit<Q extends javax.measure.Quantity<Q>>
-
equals
-