|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.doolin.util.unit.ValueUnit
public class ValueUnit
Numeric value associated with a unit.
| Constructor Summary | |
|---|---|
ValueUnit()
Constructor with no predefined value or unit. |
|
ValueUnit(Number value,
Unit unit)
Constructor with a predefined value and unit. |
|
| Method Summary | |
|---|---|
ValueUnit |
convert(Unit targetUnit,
Number reference)
Converts this value to another unit. |
boolean |
equals(Object obj)
|
Unit |
getUnit()
|
Number |
getValue()
|
int |
hashCode()
|
void |
setUnit(Unit unit)
|
void |
setValue(Number value)
|
String |
toString()
|
static ValueUnit |
valueOf(String string)
Converts a formatted string to a numeric value and a unit. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ValueUnit()
public ValueUnit(Number value,
Unit unit)
value - Numeric valueunit - Unit| Method Detail |
|---|
public static ValueUnit valueOf(String string)
string - Formatted string.
null if the string is empty
IllegalArgumentException - If the provided string cannot be parsed
public ValueUnit convert(Unit targetUnit,
Number reference)
targetUnit - Target unitreference - Reference value for the percentage unit
public boolean equals(Object obj)
equals in class Objectpublic Unit getUnit()
public Number getValue()
public int hashCode()
hashCode in class Objectpublic void setUnit(Unit unit)
unit - Associated unitpublic void setValue(Number value)
value - Associated valuepublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||