public static class DistanceUnit.Distance extends java.lang.Object implements java.lang.Comparable<DistanceUnit.Distance>
Modifier and Type | Field and Description |
---|---|
DistanceUnit |
unit |
double |
value |
Constructor and Description |
---|
Distance(double value,
DistanceUnit unit) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(DistanceUnit.Distance o) |
DistanceUnit.Distance |
convert(DistanceUnit unit)
Converts a
DistanceUnit.Distance value given in a specific DistanceUnit into
a value equal to the specified value but in a other DistanceUnit . |
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
static DistanceUnit.Distance |
parseDistance(java.lang.String distance)
Parse a
DistanceUnit.Distance from a given String. |
java.lang.String |
toString() |
public final double value
public final DistanceUnit unit
public Distance(double value, DistanceUnit unit)
public DistanceUnit.Distance convert(DistanceUnit unit)
DistanceUnit.Distance
value given in a specific DistanceUnit
into
a value equal to the specified value but in a other DistanceUnit
.unit
- unit of the resultpublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public int compareTo(DistanceUnit.Distance o)
compareTo
in interface java.lang.Comparable<DistanceUnit.Distance>
public java.lang.String toString()
toString
in class java.lang.Object
public static DistanceUnit.Distance parseDistance(java.lang.String distance)
DistanceUnit.Distance
from a given String. If no unit is given
DistanceUnit.DEFAULT
will be useddistance
- String defining a DistanceUnit.Distance
DistanceUnit.Distance