public class UnitUtil
extends java.lang.Object
Unit
:s.Modifier and Type | Field and Description |
---|---|
static java.util.regex.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,
java.lang.String quantityId,
java.lang.String symbol)
Find the unit with a given symbol for a given quantity.
|
static java.lang.String[] |
splitValueWithUnit(java.lang.String value)
Splits a value with an optional unit.
|
public static final java.util.regex.Pattern VALUE_WITH_UNIT
splitValueWithUnit(String)
public static Unit getUnit(DbControl dc, java.lang.String quantityId, java.lang.String symbol)
UnitCache
instead.dc
- The DbControl to use for database accessquantityId
- The system ID of the quantitysymbol
- The unit symbolpublic static java.lang.String[] splitValueWithUnit(java.lang.String value)
value
- The value to split