public class Quantity extends Object
Modifier and Type | Field and Description |
---|---|
static String[] |
KNOWN_UNITS |
static String[] |
KNOWN_UNITS_IMAGE_DIMENSIONS |
static Pattern |
PARSE_QUANTITY_PATTERN |
static String |
UNIT_NO_UNIT |
static Map<String,Double> |
UNITS_FACTORS
Contains factors to the standard unit
Length: m
Weight: g
Time: s
|
Constructor and Description |
---|
Quantity() |
Quantity(double value,
String unit) |
Quantity(Quantity other) |
Modifier and Type | Method and Description |
---|---|
Quantity |
convertTo(String targetUnit) |
String |
getUnit() |
double |
getValue() |
static Quantity |
parse(String string)
Parses a quantity from a string
|
void |
setUnit(String unit) |
void |
setValue(double value) |
String |
toString() |
public static final Map<String,Double> UNITS_FACTORS
public static final Pattern PARSE_QUANTITY_PATTERN
public static final String UNIT_NO_UNIT
public static final String[] KNOWN_UNITS_IMAGE_DIMENSIONS
public static final String[] KNOWN_UNITS
public Quantity()
public Quantity(double value, String unit)
public Quantity(Quantity other)
Copyright © 2020–2022 Leibniz Institute for Natural Product Research and Infection Biology - Hans Knöll Institute (HKI). All rights reserved.