Package com.storedobject.core
Class Temperature
java.lang.Object
com.storedobject.core.Quantity
com.storedobject.core.Temperature
- All Implemented Interfaces:
Storable
,Comparable<Quantity>
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTemperature
(double value, MeasurementUnit unit) Temperature
(double value, String unit) Temperature
(BigDecimal value, MeasurementUnit unit) Temperature
(BigDecimal value, String unit) -
Method Summary
Modifier and TypeMethodDescriptionabsolute()
Absolute value of this quantity.Add quantityAdd quantity valueadd
(BigDecimal quantity) Add quantityConvert the quantity to another unit.divide
(double divisor) Divide the quantity with a valuedivide
(BigDecimal divisor) Divide the quantity with a valueprotected boolean
equalsWhenZero
(Quantity another) Check if this quantity is equal to another quantity when both are zero, but their units are different.multiply
(double multiplicand) Multiplymultiply
(BigDecimal multiplicand) Multiplynegate()
Reverses the sign of this quantitySubtract quantitySubtract quantitysubtract
(BigDecimal quantity) Subtract quantityzero()
Create a quantity of this type with zero value.Methods inherited from class com.storedobject.core.Quantity
canConvert, canConvert, canConvert, canConvert, compareTo, convert, convert, convert, convertValue, create, create, create, create, create, create, create, create, create, create, create, create, divide, equals, getClass, getStorableValue, getType, getTypeName, getUnit, getUnit, getUnit, getValue, hashCode, isCompatible, isConvertible, isConvertible, isGreaterThan, isGreaterThan, isGreaterThanOrEqual, isGreaterThanOrEqual, isLessThan, isLessThan, isLessThanOrEqual, isLessThanOrEqual, isNegative, isPositive, isZero, multiply, quantityTypes, round, setUnit, setUnit, sum, toString, toString, toString, toString, types
-
Field Details
-
defaultUnit
-
-
Constructor Details
-
Temperature
public Temperature() -
Temperature
-
Temperature
-
Temperature
-
Temperature
-
-
Method Details
-
convert
Description copied from class:Quantity
Convert the quantity to another unit. -
zero
Create a quantity of this type with zero value. -
add
Add quantity value -
add
Add quantity -
add
Add quantity -
subtract
Subtract quantity -
subtract
Subtract quantity -
subtract
Subtract quantity -
multiply
Multiply -
multiply
Multiply -
divide
Divide the quantity with a value -
divide
Divide the quantity with a value -
negate
Reverses the sign of this quantity -
absolute
Absolute value of this quantity. -
equalsWhenZero
Description copied from class:Quantity
Check if this quantity is equal to another quantity when both are zero, but their units are different.Note: Some measurements such as
Temperature
are not equal when units are different.- Overrides:
equalsWhenZero
in classQuantity
- Parameters:
another
- Another quantity.- Returns:
- True if equal.
-