Interface QuantityValue
- All Superinterfaces:
Value
- All Known Implementing Classes:
QuantityValueImpl
A quantity value represents a number, possibly under some unit. The number
can be of arbitrary precision. Additional upper and lower bounds are provided
to allow an interval of uncertainty to be defined.
- Author:
- Markus Kroetzsch
-
Method Summary
Modifier and TypeMethodDescriptionReturns the upper bound for the numeric value of this quantity.Returns the main numeric value of this quantity.getUnit()
Returns the unit of this quantity, or the string "1" if there is no unit.Returns the upper bound for the numeric value of this quantity.
-
Method Details
-
getNumericValue
BigDecimal getNumericValue()Returns the main numeric value of this quantity.- Returns:
- numeric value as a decimal value of arbitrary precision
-
getLowerBound
BigDecimal getLowerBound()Returns the upper bound for the numeric value of this quantity.- Returns:
- numeric value as a decimal value of arbitrary precision or null if not set
-
getUpperBound
BigDecimal getUpperBound()Returns the upper bound for the numeric value of this quantity.- Returns:
- numeric value as a decimal value of arbitrary precision or null if not set
-
getUnit
String getUnit()Returns the unit of this quantity, or the string "1" if there is no unit. Units are typically encoded as entity IRIs.- Returns:
- unit string (IRI or the string "1" if there is no unit)
-
getUnitItemId
ItemIdValue getUnitItemId()- Returns:
- the unit of this quantity as an item id value, or null if there is no unit.
- Throws:
IllegalArgumentException
- if the unit is not "1" (no unit) or a valid item IRI
-