public final class Length extends Number implements Comparable<Length>, Serializable
| Modifier and Type | Class and Description |
|---|---|
static class |
Length.Unit
Represents a given length unit.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Length other) |
double |
doubleValue()
Return the length in meter.
|
boolean |
equals(Object obj) |
float |
floatValue() |
int |
hashCode() |
int |
intValue() |
long |
longValue() |
static Length |
of(double length,
Length.Unit unit)
Create a new
Length object with the given length. |
double |
to(Length.Unit unit)
Return the length in the desired unit.
|
String |
toString() |
byteValue, shortValuepublic double doubleValue()
doubleValue in class Numberpublic double to(Length.Unit unit)
unit - the desired length unitNullPointerException - if the given length unit is
nullpublic float floatValue()
floatValue in class Numberpublic int compareTo(Length other)
compareTo in interface Comparable<Length>public static Length of(double length, Length.Unit unit)
Length object with the given length.length - the lengthunit - the length unitLength object with the given length.NullPointerException - if the given length unit is
null© 2017-2017 Franz Wilhelmstötter (2017-11-04 19:06)