Class TimeUnit
java.lang.Object
de.xima.fc.common.measure.TimeUnit
- All Implemented Interfaces:
MeasurementUnit<Time>, Time
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TimeA daystatic final TimeA daystatic final TimeAn hourstatic final TimeAn hourstatic final TimeA microsecondstatic final TimeA millisecondstatic final TimeA minutestatic final TimeA minutestatic final TimeA millisecondstatic final TimeA nanosecondstatic final TimeA nanosecondstatic final TimeA secondstatic final TimeA secondstatic final TimeA microsecond -
Method Summary
Modifier and TypeMethodDescriptionlongThe denominator of the fraction representing the conversion factor from this unit to the reference unit.longThe numerator of the fraction representing the conversion factor from this unit to the reference unit.booleaninthashCode()final QuantityDouble<Time> of(double value) Creates a newQuantityDoublethat uses double object with the specified value in this unit.of(BigDecimal value) Creates a newQuantityBigDecimalthat uses big decimal object with the specified value in this unit.protected Timeself()symbol()The reference unit of this measurement unit.toString()Gets a string representation of the unit, usually the unit symbol such as "m" for meters or "kg" for kilograms.Methods inherited from interface MeasurementUnit
conversionFactorDenominator, conversionFactorNumerator, of, of, symbol, toString
-
Field Details
-
D
A day -
DAY
A day -
H
An hour -
HOUR
An hour -
MICROSECOND
A microsecond -
MILLISECOND
A millisecond -
MIN
A minute -
MINUTE
A minute -
MS
A millisecond -
NANOSECOND
A nanosecond -
NS
A nanosecond -
S
A second -
SECOND
A second -
US
A microsecond
-
-
Method Details
-
equals
-
self
-
conversionFactorDenominator
public long conversionFactorDenominator()Description copied from interface:MeasurementUnitThe denominator of the fraction representing the conversion factor from this unit to the reference unit.- Specified by:
conversionFactorDenominatorin interfaceMeasurementUnit<Self extends MeasurementUnit<Self>>- Returns:
- The conversion factor denominator.
-
conversionFactorNumerator
public long conversionFactorNumerator()Description copied from interface:MeasurementUnitThe numerator of the fraction representing the conversion factor from this unit to the reference unit.- Specified by:
conversionFactorNumeratorin interfaceMeasurementUnit<Self extends MeasurementUnit<Self>>- Returns:
- The conversion factor numerator.
-
hashCode
-
of
Description copied from interface:MeasurementUnitCreates a newQuantityDoublethat uses double object with the specified value in this unit.- Specified by:
ofin interfaceMeasurementUnit<Self extends MeasurementUnit<Self>>- Parameters:
value- The value in this unit.- Returns:
- A new
QuantityDoubleobject with the specified value in this unit.
-
of
Description copied from interface:MeasurementUnitCreates a newQuantityBigDecimalthat uses big decimal object with the specified value in this unit.- Specified by:
ofin interfaceMeasurementUnit<Self extends MeasurementUnit<Self>>- Parameters:
value- The value in this unit.- Returns:
- A new
QuantityBigDecimalobject with the specified value in this unit.
-
symbol
Description copied from interface:MeasurementUnitThe reference unit of this measurement unit. Also serves as a unique identifier for the unit.- Specified by:
symbolin interfaceMeasurementUnit<Self extends MeasurementUnit<Self>>- Returns:
- The unit symbol.
-
toString
Description copied from interface:MeasurementUnitGets a string representation of the unit, usually the unit symbol such as "m" for meters or "kg" for kilograms.- Specified by:
toStringin interfaceMeasurementUnit<Self extends MeasurementUnit<Self>>- Overrides:
toStringin classObject- Returns:
- The reference unit.
-