public final class Length extends AbstractMeasure<LengthUnit,Length>
LengthUnit.
Use values of Length directly in arithmetic expressions with other dimensions such as:
// commonly used unit abbreviations e.g., m, ft, hr, mph, etc.
import static manifold.science.util.UnitConstants.*;
...
Length l = 5m; // 5 meters
Length height = 5 ft + 9.5 in;
Area room = 20 ft * 15.5 ft;
Length distance = 80 mph * 2.3 hr;
ComparableUsing.EqualityMode, ComparableUsing.Operator| Constructor and Description |
|---|
Length(Rational value,
LengthUnit unit) |
Length(Rational value,
LengthUnit unit,
LengthUnit displayUnit) |
| Modifier and Type | Method and Description |
|---|---|
Velocity |
div(Time t) |
Time |
div(Velocity v) |
LengthUnit |
getBaseUnit()
The unit on which all instances of this type are based.
|
Length |
make(Rational value,
LengthUnit unit)
Creates a new instance using the specified parameters.
|
Length |
make(Rational value,
LengthUnit unit,
LengthUnit displayUnit)
Creates a new instance using the specified parameters.
|
Volume |
times(Area area) |
Energy |
times(Force force) |
Area |
times(Length len) |
compareTo, copy, copy, div, equalityMode, equals, fromBaseNumber, fromNumber, getDisplayUnit, getValue, hashCode, minus, nextInSequence, nextNthInSequence, plus, previousInSequence, previousNthInSequence, rem, to, toBaseNumber, toMixedString, toNumber, toNumber, toStringclone, emptyArray, finalize, getClass, jailbreak, notify, notifyAll, wait, wait, waitdiv, rem, times, unaryMinuscompareToUsingpublic Length(Rational value, LengthUnit unit, LengthUnit displayUnit)
public Length(Rational value, LengthUnit unit)
public LengthUnit getBaseUnit()
AbstractMeasureLength dimension might use Meters
as the base unit because it is the SI standard.getBaseUnit in class AbstractMeasure<LengthUnit,Length>public Length make(Rational value, LengthUnit unit, LengthUnit displayUnit)
AbstractMeasuremake in class AbstractMeasure<LengthUnit,Length>public Length make(Rational value, LengthUnit unit)
AbstractMeasuremake in class AbstractMeasure<LengthUnit,Length>Copyright © 2024. All rights reserved.