Package com.storedobject.core
Class Distance
java.lang.Object
com.storedobject.core.Quantity
com.storedobject.core.Distance
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BigDecimal
static final BigDecimal
static final BigDecimal
static final MeasurementUnit
-
Constructor Summary
ConstructorsConstructorDescriptionDistance()
Distance
(double value, MeasurementUnit unit) Distance
(BigDecimal value, MeasurementUnit unit) Distance
(BigDecimal value, String unit) -
Method Summary
Modifier and TypeMethodDescriptionabsolute()
Absolute value of this quantity.Add quantityAdd quantity valueadd
(BigDecimal quantity) Add quantitycircle()
Create a circle by taking this as the radius of the circle.cube()
Create a cube by taking this as the side of the cube.divide
(double divisor) Divide the quantity with a valuedivide
(BigDecimal divisor) Divide the quantity with a valuemultiply
(double multiplicand) Multiplymultiply
(BigDecimal multiplicand) Multiplynegate()
Reverses the sign of this quantityCreate a rectangle by taking this as the length and the given parameter value as the width.square()
Create a square by taking this as the side of the square.Subtract 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, convert, convertValue, create, create, create, create, create, create, create, create, create, create, create, create, divide, equals, equalsWhenZero, 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
-
BD_KM
-
BD_CM
-
BD_MM
-
defaultUnit
-
-
Constructor Details
-
Distance
public Distance() -
Distance
-
Distance
-
Distance
-
Distance
-
-
Method Details
-
zero
-
add
-
add
Add quantity -
add
-
subtract
-
subtract
Subtract quantity -
subtract
-
multiply
Multiply -
multiply
-
divide
-
divide
Divide the quantity with a value -
negate
-
absolute
-
rectangle
-
square
Create a square by taking this as the side of the square.- Returns:
- Square area.
-
circle
Create a circle by taking this as the radius of the circle.- Returns:
- Circular area.
-
cube
-