Package tech.units.indriya
Interface ComparableQuantity<Q extends javax.measure.Quantity<Q>>
- Type Parameters:
Q-
- All Superinterfaces:
Comparable<javax.measure.Quantity<Q>>,javax.measure.Quantity<Q>,tech.uom.lib.common.function.QuantityConverter<Q>,Serializable
- All Known Implementing Classes:
AbstractQuantity,BigIntegerQuantity,ByteQuantity,DecimalQuantity,DoubleQuantity,FloatQuantity,IntegerQuantity,LongQuantity,NumberQuantity,ShortQuantity,TemporalQuantity,TimeUnitQuantity
public interface ComparableQuantity<Q extends javax.measure.Quantity<Q>>
extends javax.measure.Quantity<Q>, Comparable<javax.measure.Quantity<Q>>, tech.uom.lib.common.function.QuantityConverter<Q>, Serializable
- Since:
- 1.0
- Version:
- 1.0.2, December 29, 2017
-
Method Summary
Modifier and TypeMethodDescription<T extends javax.measure.Quantity<T>>
ComparableQuantity<T> divide(javax.measure.Quantity<?> that) <T extends javax.measure.Quantity<T>,E extends javax.measure.Quantity<E>>
ComparableQuantity<E> Multiply and cast theComparableQuantityinverse()<T extends javax.measure.Quantity<T>>
ComparableQuantity<T> invert and already cast to defined quantityClassbooleanisEquivalentOf(javax.measure.Quantity<Q> that) Compares two instances of, doing the conversion of unit if necessary.booleanisGreaterThan(javax.measure.Quantity<Q> that) Compares two instances of.booleanisGreaterThanOrEqualTo(javax.measure.Quantity<Q> that) Compares two instances of, doing the conversion of unit if necessary.booleanisLessThan(javax.measure.Quantity<Q> that) Compares two instances of, doing the conversion of unit if necessary.booleanisLessThanOrEqualTo(javax.measure.Quantity<Q> that) Compares two instances of, doing the conversion of unit if necessary.multiply(javax.measure.Quantity<?> multiplier) <T extends javax.measure.Quantity<T>,E extends javax.measure.Quantity<E>>
ComparableQuantity<E> Divide and cast theComparableQuantityMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface javax.measure.Quantity
getUnit, getValue
-
Method Details
-
add
-
subtract
-
divide
-
divide
-
multiply
-
multiply
-
inverse
ComparableQuantity<?> inverse() -
inverse
invert and already cast to defined quantityClass- Parameters:
quantityClass- Quantity to be converted- See Also:
-
to
-
asType
<T extends javax.measure.Quantity<T>> ComparableQuantity<T> asType(Class<T> type) throws ClassCastException - Specified by:
asTypein interfacejavax.measure.Quantity<Q extends javax.measure.Quantity<Q>>- Throws:
ClassCastException- See Also:
-
isGreaterThan
Compares two instances of. Conversion of unit can happen if necessary- Parameters:
that- thequantity<Q>to be compared with this instance.- Returns:
trueifthat > this.- Throws:
NullPointerException- if the that is null
-
isGreaterThanOrEqualTo
Compares two instances of, doing the conversion of unit if necessary.- Parameters:
that- thequantity<Q>to be compared with this instance.- Returns:
trueifthat >= this.- Throws:
NullPointerException- if the that is null
-
isLessThan
Compares two instances of, doing the conversion of unit if necessary.- Parameters:
that- thequantity<Q>to be compared with this instance.- Returns:
trueifthat < this.- Throws:
NullPointerException- if the quantity is null
-
isLessThanOrEqualTo
Compares two instances of, doing the conversion of unit if necessary.- Parameters:
that- thequantity<Q>to be compared with this instance.- Returns:
trueifthat < this.- Throws:
NullPointerException- if the quantity is null
-
isEquivalentOf
Compares two instances of, doing the conversion of unit if necessary.- Parameters:
that- thequantity<Q>to be compared with this instance.- Returns:
trueifthat < this.- Throws:
NullPointerException- if the quantity is null
-
divide
<T extends javax.measure.Quantity<T>,E extends javax.measure.Quantity<E>> ComparableQuantity<E> divide(javax.measure.Quantity<T> that, Class<E> asTypeQuantity) Multiply and cast theComparableQuantity- Parameters:
that- quantity to be multipliedasTypeQuantity- quantity to be converted- Returns:
- the QuantityOperations multiplied and converted
- Throws:
NullPointerException- See Also:
-
multiply
<T extends javax.measure.Quantity<T>,E extends javax.measure.Quantity<E>> ComparableQuantity<E> multiply(javax.measure.Quantity<T> that, Class<E> asTypeQuantity) Divide and cast theComparableQuantity- Parameters:
that- quantity to be dividedasTypeQuantity- quantity to be converted- Returns:
- the QuantityOperations multiplied and converted
- Throws:
NullPointerException- See Also:
-