public class Quantity extends java.lang.Object
Defined by the amount and Unit
Units are based on Recommendation N°. 20 - Codes for Units of Measure Used in International Trade
| Constructor and Description |
|---|
Quantity()
|
Quantity(java.math.BigDecimal value,
java.lang.String unitCode)
|
Quantity(java.math.BigDecimal value,
UnitOfMeasurement unit)
|
| Modifier and Type | Method and Description |
|---|---|
UnitOfMeasurement |
getUnit()
|
java.lang.String |
getUnitCode()
|
java.math.BigDecimal |
getValue()
|
void |
setUnit(UnitOfMeasurement unit)
|
void |
setUnitCode(java.lang.String newUnitCode)
|
void |
setValue(java.math.BigDecimal value)
|
public Quantity()
Instantiates a new quantity.
public Quantity(java.math.BigDecimal value, java.lang.String unitCode)
Instantiates a new quantity.
value - the valueunitCode - the unit codepublic Quantity(java.math.BigDecimal value, UnitOfMeasurement unit)
Instantiates a new quantity.
value - the valueunit - the unitpublic UnitOfMeasurement getUnit()
Gets the unit.
public java.lang.String getUnitCode()
Gets the unit code.
public java.math.BigDecimal getValue()
Gets the value.
public void setUnit(UnitOfMeasurement unit)
Sets the unit.
unit - the new unitpublic void setUnitCode(java.lang.String newUnitCode)
Sets the unit code.
newUnitCode - the new unit codepublic void setValue(java.math.BigDecimal value)
Sets the value.
value - the new valueCopyright © 2014 konik.io. All Rights Reserved.