Modifier and Type | Field and Description |
---|---|
static Pattern |
VALUE_WITH_UNIT
Pattern for checking if a string is a numeric value with an
optional unit.
|
Constructor and Description |
---|
UnitUtil() |
Modifier and Type | Method and Description |
---|---|
static Unit |
getUnit(DbControl dc,
String quantityId,
String symbol)
Find the unit with a given symbol for a given quantity.
|
static String[] |
splitValueWithUnit(String value)
Splits a value with an optional unit.
|
public static final Pattern VALUE_WITH_UNIT
splitValueWithUnit(String)
public static Unit getUnit(DbControl dc, String quantityId, String symbol)
UnitCache
instead.dc
- The DbControl to use for database accessquantityId
- The system ID of the quantitysymbol
- The unit symbolpublic static String[] splitValueWithUnit(String value)
value
- The value to split