Package ome.units.quantity
Class Length
java.lang.Object
ome.units.quantity.Quantity
ome.units.quantity.Length
- All Implemented Interfaces:
java.lang.Comparable<Length>
public class Length extends Quantity implements java.lang.Comparable<Length>
Length quantity.
- Since:
- 5.1
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description intcompareTo(Length other)Check quantities for equality.booleanequals(java.lang.Object other)Check quantities for equality.inthashCode()java.lang.StringtoString()Unit<Length>unit()Get the unit for this quantity.java.lang.Numbervalue()Get the numerical value of this quantity.java.lang.Numbervalue(Unit<Length> inUnit)Perform a unit conversion.
-
Constructor Details
-
Length
Create a Length.- Parameters:
inValue- the value.inUnit- the unit type.
-
-
Method Details
-
value
public java.lang.Number value()Description copied from class:QuantityGet the numerical value of this quantity. -
value
Perform a unit conversion.- Parameters:
inUnit- the unit to convert to.- Returns:
- the current quantity value converted to the specified unit, or null if the conversion is not possible.
-
equals
public boolean equals(java.lang.Object other)Check quantities for equality. Unit conversion will be performed when required to convert into the unit system of this quantity in order to perform the comparison. Note that floating point comparison is dangerous. Do not use this method.- Overrides:
equalsin classjava.lang.Object- Returns:
- true if equal, false if not equal.
-
compareTo
Check quantities for equality. Unit conversion will be performed when required to convert into the unit system of this quantity in order to perform the comparison. Note that floating point comparison is dangerous. Do not use this method.- Specified by:
compareToin interfacejava.lang.Comparable<Length>- Returns:
- true if equal, false if not equal.
-
hashCode
public int hashCode()- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-
unit
Description copied from class:QuantityGet the unit for this quantity.
-