public final class TimeUnitQuantity extends AbstractQuantity<javax.measure.quantity.Time>
TimeUnit 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).
|
TimeUnit |
getTimeUnit()
get to
TimeUnit |
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 TimeUnitQuantity |
of(javax.measure.Quantity<javax.measure.quantity.Time> quantity)
|
static TimeUnitQuantity |
of(TimeUnit timeUnit,
Integer number)
|
ComparableQuantity<javax.measure.quantity.Time> |
subtract(javax.measure.Quantity<javax.measure.quantity.Time> that) |
TimeUnitQuantity |
to(TimeUnit timeUnit) |
javax.measure.Quantity<javax.measure.quantity.Time> |
toQuantity()
Converts the
TimeUnitQuantity to Quantity |
String |
toString()
Returns the
String representation of this quantity. |
javax.measure.Unit<javax.measure.quantity.Time> |
toUnit()
converts the
TimeUnit to Unit |
asType, compareTo, divide, equals, floatValue, getUnit, intValue, inverse, isEquivalentTo, isGreaterThan, isGreaterThanOrEqualTo, isLessThan, isLessThanOrEqualTo, longValue, multiply, parse, to, to, toSIpublic static TimeUnitQuantity of(TimeUnit timeUnit, Integer number)
timeUnit - - time to be usedvalue - - value to be usedpublic static TimeUnitQuantity of(javax.measure.Quantity<javax.measure.quantity.Time> quantity)
quantity - - quantity to be usedTimeUnitQuantity converted be quantity in seconds.public TimeUnit getTimeUnit()
TimeUnitpublic 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()
TimeUnit to UnitgetTimeUnit() converted to Unitpublic javax.measure.Quantity<javax.measure.quantity.Time> toQuantity()
TimeUnitQuantity to Quantitypublic TimeUnitQuantity to(TimeUnit 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.