public class Length extends java.lang.Object implements java.lang.Cloneable, java.lang.Comparable<Length>, java.io.Serializable
Modifier and Type | Class and Description |
---|---|
static class |
Length.Units |
Modifier and Type | Field and Description |
---|---|
protected MeasuredValue |
mv |
protected Length.Units |
units |
Constructor and Description |
---|
Length(double value,
Length.Units units) |
Modifier and Type | Method and Description |
---|---|
Length |
clone() |
int |
compareTo(Length other)
Implements java.lang.Comparable; compares after any necessary unit
conversions so, eg, 1 m == 100 cm.
|
boolean |
equals(java.lang.Object other)
Equality after doing any necessary unit conversions, and within a
tolerance which is the current value multiplied by 1.0E-15.
|
boolean |
equals(java.lang.Object other,
Length tolerance)
Equality after doing any necessary unit conversions, and within the
given tolerance.
|
Length.Units |
getUnits() |
MeasuredValue |
getValue() |
double |
getValue(Length.Units requiredUnits) |
int |
hashCode() |
java.lang.String |
toString() |
protected MeasuredValue mv
protected Length.Units units
public Length(double value, Length.Units units)
public MeasuredValue getValue()
public Length.Units getUnits()
public double getValue(Length.Units requiredUnits)
public boolean equals(java.lang.Object other, Length tolerance)
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int compareTo(Length other)
compareTo
in interface java.lang.Comparable<Length>
public Length clone()
clone
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object