Class LengthUnit
java.lang.Object
de.xima.fc.common.measure.LengthUnit
- All Implemented Interfaces:
Length, MeasurementUnit<Length>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final LengthA centimeterstatic final LengthA centimeterstatic final LengthA decimeterstatic final LengthA decimeterstatic final LengthAn inch (2.54cm)static final LengthA kilometerstatic final LengthA kilometerstatic final LengthA meterstatic final LengthA meterstatic final LengthA micrometerstatic final LengthA millimeterstatic final LengthA millimeterstatic final LengthA nanometerstatic final LengthA nanometerstatic final LengthA pixel. 1px = 1/96th of 1 inch.static final LengthA pixel. 1pt = 1/72th of 1 inch.static final LengthA pixel. 1pt = 1/72th of 1 inch.static final LengthA pixel. 1px = 1/96th of 1 inch.static final LengthA micrometer -
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<Length> 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 Lengthself()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
-
CENTIMETER
A centimeter -
CM
A centimeter -
DECIMETER
A decimeter -
DM
A decimeter -
INCH
An inch (2.54cm) -
KILOMETER
A kilometer -
KM
A kilometer -
M
A meter -
METER
A meter -
MICROMETER
A micrometer -
MILLIMETER
A millimeter -
MM
A millimeter -
NANOMETER
A nanometer -
NM
A nanometer -
PIXEL
A pixel. 1px = 1/96th of 1 inch. -
POINT
A pixel. 1pt = 1/72th of 1 inch. -
PT
A pixel. 1pt = 1/72th of 1 inch. -
PX
A pixel. 1px = 1/96th of 1 inch. -
UM
A micrometer
-
-
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.
-