java.lang.Object
java.lang.Number
io.jenetics.jpx.Length
- All Implemented Interfaces:
Serializable,Comparable<Length>
Extent of something along its greatest dimension or the extent of space
between two objects or places. The metric system unit for this quantity is
"m" (metre).
- Since:
- 1.0
- Version:
- 1.2
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionintdoubleReturn the length in meter.booleanfloatinthashCode()intintValue()longstatic Lengthof(double length, Length.Unit unit) Create a newLengthobject with the given length.doubleto(Length.Unit unit) Return the length in the desired unit.toString()Methods inherited from class java.lang.Number
byteValue, shortValue
-
Method Details
-
doubleValue
Return the length in meter.- Specified by:
doubleValuein classNumber- Returns:
- the length in meter
-
to
Return the length in the desired unit.- Parameters:
unit- the desired length unit- Returns:
- the length in the desired unit
- Throws:
NullPointerException- if the given lengthunitisnull
-
intValue
-
longValue
-
floatValue
- Specified by:
floatValuein classNumber
-
compareTo
- Specified by:
compareToin interfaceComparable<Length>
-
hashCode
-
equals
-
toString
-
of
Create a newLengthobject with the given length.- Parameters:
length- the lengthunit- the length unit- Returns:
- a new
Lengthobject with the given length. - Throws:
NullPointerException- if the given lengthunitisnull
-