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, toString
clone, emptyArray, finalize, getClass, jailbreak, notify, notifyAll, wait, wait, wait
div, rem, times, unaryMinus
compareToUsing
public Length(Rational value, LengthUnit unit, LengthUnit displayUnit)
public Length(Rational value, LengthUnit unit)
public LengthUnit getBaseUnit()
AbstractMeasure
Length
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)
AbstractMeasure
make
in class AbstractMeasure<LengthUnit,Length>
public Length make(Rational value, LengthUnit unit)
AbstractMeasure
make
in class AbstractMeasure<LengthUnit,Length>
Copyright © 2024. All rights reserved.