public final class TemporalQuantity extends AbstractQuantity<javax.measure.quantity.Time>
TemporalUnit in Unit-APIAbstractQuantity.EqualizerNONE, ONE| Modifier and Type | Method and Description |
|---|---|
ComparableQuantity<javax.measure.quantity.Time> |
add(javax.measure.Quantity<javax.measure.quantity.Time> that) |
BigDecimal |
decimalValue(javax.measure.Unit<javax.measure.quantity.Time> unit,
MathContext ctx) |
ComparableQuantity<javax.measure.quantity.Time> |
divide(Number that) |
ComparableQuantity<?> |
divide(javax.measure.Quantity<?> that) |
double |
doubleValue(javax.measure.Unit<javax.measure.quantity.Time> unit) |
boolean |
equals(Object obj)
Compares this quantity against the specified object for strict equality (same unit and same amount).
|
TemporalAmount |
getTemporalAmount()
get to
TemporalAmount |
TemporalUnit |
getTemporalUnit()
get to
TemporalUnit |
Integer |
getValue()
get value expressed in
Integer |
int |
hashCode()
Returns the hash code for this quantity.
|
ComparableQuantity<?> |
inverse() |
boolean |
isBig() |
ComparableQuantity<javax.measure.quantity.Time> |
multiply(Number multiplier) |
ComparableQuantity<?> |
multiply(javax.measure.Quantity<?> multiplier) |
static TemporalQuantity |
of(Integer number,
TemporalUnit timeUnit)
|
static TemporalQuantity |
of(javax.measure.Quantity<javax.measure.quantity.Time> quantity)
|
ComparableQuantity<javax.measure.quantity.Time> |
subtract(javax.measure.Quantity<javax.measure.quantity.Time> that) |
TemporalQuantity |
to(TemporalUnit timeUnit) |
javax.measure.Quantity<javax.measure.quantity.Time> |
toQuantity()
Converts the
TemporalQuantity to Quantity |
String |
toString()
Returns the
String representation of this quantity. |
javax.measure.Unit<javax.measure.quantity.Time> |
toUnit()
converts the
TemporalUnit to Unit |
asType, compareTo, divide, equals, floatValue, getUnit, intValue, inverse, isEquivalentTo, isGreaterThan, isGreaterThanOrEqualTo, isLessThan, isLessThanOrEqualTo, longValue, multiply, parse, to, to, toSIpublic static TemporalQuantity of(Integer number, TemporalUnit timeUnit)
value - - value to be usedtimeUnit - - time to be usedpublic static TemporalQuantity of(javax.measure.Quantity<javax.measure.quantity.Time> quantity)
quantity - - quantity to be usedTemporalQuantity converted be quantity in seconds.public TemporalAmount getTemporalAmount()
TemporalAmountpublic TemporalUnit getTemporalUnit()
TemporalUnitpublic Integer getValue()
IntegergetValue in interface javax.measure.Quantity<javax.measure.quantity.Time>getValue in interface tec.uom.lib.common.function.ValueSupplier<Number>getValue in class AbstractQuantity<javax.measure.quantity.Time>public javax.measure.Unit<javax.measure.quantity.Time> toUnit()
TemporalUnit to UnitgetTemporalUnit() converted to Unitpublic javax.measure.Quantity<javax.measure.quantity.Time> toQuantity()
TemporalQuantity to Quantitypublic TemporalQuantity to(TemporalUnit timeUnit)
public int hashCode()
AbstractQuantityhashCode in class AbstractQuantity<javax.measure.quantity.Time>public boolean equals(Object obj)
AbstractQuantity
Similarly to the BigDecimal.equals(java.lang.Object) method which consider 2.0 and 2.00 as different objects because of different internal scales,
quantities such as Quantities.getQuantity(3.0, KILOGRAM) Quantities.getQuantity(3, KILOGRAM) and
Quantities.getQuantity("3 kg") might not be considered equals because of possible differences in their implementations.
To compare quantities stated using different units or using different amount implementations the compareTo or
equals(Quantity, epsilon, epsilonUnit) methods should be used.
equals in class AbstractQuantity<javax.measure.quantity.Time>obj - the object to compare with.this.getUnit.equals(obj.getUnit())
&& this.getValue().equals(obj.getValue())public String toString()
AbstractQuantityString representation of this quantity. The string produced for a given quantity is always the same; it is not affected
by locale. This means that it can be used as a canonical string representation for exchanging quantity, or as a key for a Hashtable, etc.
Locale-sensitive quantity formatting and parsing is handled by the MeasurementFormat class and its subclasses.toString in class AbstractQuantity<javax.measure.quantity.Time>UnitFormat.getInternational().format(this)public ComparableQuantity<javax.measure.quantity.Time> add(javax.measure.Quantity<javax.measure.quantity.Time> that)
Quantity.add(Quantity)public ComparableQuantity<javax.measure.quantity.Time> subtract(javax.measure.Quantity<javax.measure.quantity.Time> that)
Quantity.subtract(Quantity)public ComparableQuantity<?> divide(javax.measure.Quantity<?> that)
Quantity.divide(Quantity)public ComparableQuantity<javax.measure.quantity.Time> divide(Number that)
Quantity.divide(Number)public ComparableQuantity<?> multiply(javax.measure.Quantity<?> multiplier)
Quantity.multiply(Quantity)public ComparableQuantity<javax.measure.quantity.Time> multiply(Number multiplier)
Quantity.multiply(Number)public ComparableQuantity<?> inverse()
Quantity.inverse()public boolean isBig()
isBig in class AbstractQuantity<javax.measure.quantity.Time>public BigDecimal decimalValue(javax.measure.Unit<javax.measure.quantity.Time> unit, MathContext ctx) throws ArithmeticException
decimalValue in class AbstractQuantity<javax.measure.quantity.Time>ArithmeticExceptionpublic double doubleValue(javax.measure.Unit<javax.measure.quantity.Time> unit) throws ArithmeticException
doubleValue in class AbstractQuantity<javax.measure.quantity.Time>ArithmeticExceptionCopyright © 2005–2017 Units of Measurement project. All rights reserved.