|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openwms.common.domain.values.Weight
public class Weight
A Weight represents a real world weight, that comes with an Unit
and a value.
Constructor Summary | |
---|---|
Weight(BigDecimal value,
WeightUnit unit)
Create a new Weight . |
|
Weight(double value,
WeightUnit unit)
Create a new Weight . |
|
Weight(int value,
WeightUnit unit)
Create a new Weight . |
Method Summary | |
---|---|
int |
compareTo(Weight o)
|
void |
convertTo(WeightUnit unt)
Convert this unit into another Unit . |
WeightUnit |
getUnit()
Returns the unit of the Weight . |
BigDecimal |
getValue()
Returns the value of the Weight . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Weight(BigDecimal value, WeightUnit unit)
Weight
.
value
- The value of the Weight
unit
- The unit of measurepublic Weight(int value, WeightUnit unit)
Weight
.
value
- The value of the Weight
as intunit
- The unit of measurepublic Weight(double value, WeightUnit unit)
Weight
.
value
- The value of the Weight
as doubleunit
- The unit of measureMethod Detail |
---|
public WeightUnit getUnit()
Weight
.
public BigDecimal getValue()
Weight
.
public void convertTo(WeightUnit unt)
Unit
.
convertTo
in interface Unit<WeightUnit>
unt
- The unit to convert topublic int compareTo(Weight o)
compareTo
in interface Comparable<Weight>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |