Class StandardUnit<Q extends Quantity<Q>>
java.lang.Object
org.episteme.core.measure.StandardUnit<Q>
- All Implemented Interfaces:
Unit<Q>
- Direct Known Subclasses:
Currency
-
Constructor Summary
ConstructorsConstructorDescriptionStandardUnit(String symbol, String name, Dimension dimension) Creates a base unit (defines the dimension). -
Method Summary
Modifier and TypeMethodDescriptionadd(double offset) Returns a unit equal to this unit shifted by the specified offset.divide(double divisor) Returns a unit equal to this unit divided by the specified factor.Unit<?> Returns the quotient of this unit by another unit.booleangetConverterTo(Unit<Q> targetUnit) Returns a converter to convert values from this unit to the target unit.Returns the dimension of this unit.getName()Returns the human-readable name for this unit (e.g., "meter", "kilogram").Returns the symbol for this unit (e.g., "m", "kg", "s").inthashCode()booleanChecks if this is a base SI unit (meter, kilogram, second, etc.).multiply(double factor) Returns a unit equal to this unit multiplied by the specified factor.Unit<?> Returns the product of this unit with another unit.Unit<?> pow(int exponent) Returns this unit raised to the specified power.Unit<?> sqrt()Returns the square root of this unit.toString()Methods inherited from interface Unit
asType, getConverterFrom, inverse, isCompatible
-
Constructor Details
-
StandardUnit
-
-
Method Details
-
getSymbol
-
getName
-
getDimension
-
getConverterTo
Description copied from interface:UnitReturns a converter to convert values from this unit to the target unit.Both units must have compatible dimensions.
- Specified by:
getConverterToin interfaceUnit<Q extends Quantity<Q>>- Parameters:
targetUnit- the target unit- Returns:
- a converter from this unit to the target
-
multiply
Description copied from interface:UnitReturns a unit equal to this unit multiplied by the specified factor.For example,
METER.multiply(1000)gives kilometer. -
divide
Description copied from interface:UnitReturns a unit equal to this unit divided by the specified factor.For example,
METER.divide(100)gives centimeter. -
multiply
Description copied from interface:UnitReturns the product of this unit with another unit.For example, multiplying Length by Length gives Area.
-
divide
Description copied from interface:UnitReturns the quotient of this unit by another unit.For example, dividing Length by Time gives Velocity.
-
add
-
pow
Description copied from interface:UnitReturns this unit raised to the specified power.For example,
METER.pow(2)gives square meters (area). -
sqrt
-
isBaseUnit
-
toString
-
equals
-
hashCode
-