Package | Description |
---|---|
org.unitConverter.unit |
Everything to do with the units that make up Unit Converter.
|
Modifier and Type | Class and Description |
---|---|
class |
BaseUnit
A unit that other units are defined by.
|
class |
LinearUnit
A unit that can be expressed as a product of its base and a number.
|
Modifier and Type | Field and Description |
---|---|
static Unit |
SI.BEL |
static Unit |
SI.CELSIUS |
static Unit |
SI.DECIBEL |
static Unit |
USCustomary.FAHRENHEIT |
static Unit |
BritishImperial.FAHRENHEIT |
static Unit |
SI.NEPER |
Modifier and Type | Method and Description |
---|---|
static Unit |
Unit.fromConversionFunctions(ObjectProduct<BaseUnit> base,
java.util.function.DoubleUnaryOperator converterFrom,
java.util.function.DoubleUnaryOperator converterTo)
Returns a unit from its base and the functions it uses to convert to and from its base.
|
static Unit |
Unit.fromConversionFunctions(ObjectProduct<BaseUnit> base,
java.util.function.DoubleUnaryOperator converterFrom,
java.util.function.DoubleUnaryOperator converterTo,
NameSymbol ns)
Returns a unit from its base and the functions it uses to convert to and from its base.
|
Unit |
UnitDatabase.getUnit(java.lang.String name)
Gets a unit from the database from its name, looking for prefixes.
|
Unit |
UnitDatabase.getUnitFromExpression(java.lang.String expression)
Uses the database's unit data to parse an expression into a unit
|
Unit |
Unit.withName(NameSymbol ns) |
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,Unit> |
UnitDatabase.unitMap()
Returns a map mapping unit names to units, including units with prefixes.
|
java.util.Map<java.lang.String,Unit> |
UnitDatabase.unitMapPrefixless() |
Modifier and Type | Method and Description |
---|---|
void |
UnitDatabase.addUnit(java.lang.String name,
Unit unit)
Adds a unit to the database.
|
boolean |
Unit.canConvertTo(Unit other)
Checks if a value expressed in this unit can be converted to a value expressed in
other |
double |
Unit.convertTo(Unit other,
double value)
Converts a value expressed in this unit to a value expressed in
other . |
static LinearUnit |
LinearUnit.fromUnitValue(Unit unit,
double value)
Gets a
LinearUnit from a unit and a value. |
static LinearUnit |
LinearUnit.fromUnitValue(Unit unit,
double value,
NameSymbol ns)
Gets a
LinearUnit from a unit and a value. |