public class IlvLinearUnit extends IlvUnit
IlvLinearUnit
is the meter.
IlvLinearUnit
has constants defining usual units :
METER
defines meters.
KILOMETER
defines kilometers.
KMI
defines international nautical miles.
FT
defines international feet.
MI
defines international statue miles (land
miles).
GetRegisteredUnit
method or listed using the
GetRegisteredUnits
method of the superclass,
IlvUnit
.
IlvUnit
,
Serialized FormModifier and Type | Field and Description |
---|---|
static IlvLinearUnit |
FT
The unit representing international feet.
|
static IlvLinearUnit |
KILOMETER
The unit representing kilometers.
|
static IlvLinearUnit |
KMI
The unit representing international nautical miles.
|
static IlvLinearUnit |
METER
The unit representing meters.
|
static IlvLinearUnit |
MI
The unit representing international statute miles.
|
Constructor and Description |
---|
IlvLinearUnit(double metersPerUnit,
String abbreviation,
String fullname)
Constructs a new linear unit.
|
IlvLinearUnit(IlvInputStream stream)
Reads the object from an
IlvInputStream object. |
IlvLinearUnit(IlvLinearUnit source)
Constructs a new linear unit by copying an existing one.
|
Modifier and Type | Method and Description |
---|---|
IlvUnit |
copy()
Returns a copy of this
IlvLinearUnit . |
boolean |
equivalent(IlvUnit unit)
Returns
true if the specified unit is equivalent to this
one. |
double |
fromKernel(double value)
Converts the value specified in the kernel unit of the quantity measured
by this unit, to values in this unit.
|
double |
fromMeters(double meters)
Converts meters to this unit.
|
double |
getMetersPerUnit()
Returns the number of meters per unit.
|
double |
toKernel(double value)
Converts the value specified in the units of this
IlvUnit to
the kernel unit (that is, meters). |
double |
toMeters(double unit)
Converts this unit to meters.
|
void |
write(IlvOutputStream stream)
Writes the object to the specified
IlvOutputStream . |
equals, getAbbreviation, getLocalizedAbbreviation, getLocalizedName, getName, GetRegisteredUnit, GetRegisteredUnits, toString
public static final IlvLinearUnit METER
public static final IlvLinearUnit KILOMETER
public static final IlvLinearUnit KMI
public static final IlvLinearUnit FT
public static final IlvLinearUnit MI
public IlvLinearUnit(double metersPerUnit, String abbreviation, String fullname)
metersPerUnit
- The number of meters per unit.abbreviation
- The abbreviation of the unit.fullname
- The name of the unit.public IlvLinearUnit(IlvLinearUnit source)
source
- The source unit.public IlvLinearUnit(IlvInputStream stream) throws IlvReadFileException
IlvInputStream
object.stream
- The input stream.IlvReadFileException
- If the format is not correct.public void write(IlvOutputStream stream) throws IOException
IlvOutputStream
.write
in interface IlvPersistentObject
write
in class IlvUnit
stream
- The stream to write this unit to.IOException
- If an I/O error occurs.public final double getMetersPerUnit()
public final double fromMeters(double meters)
meters
- The value to convert, expressed in meters.public final double toMeters(double unit)
unit
- The value to convert, expressed in this unit.public final double toKernel(double value)
IlvUnit
to
the kernel unit (that is, meters).public final double fromKernel(double value)
fromKernel
in class IlvUnit
value
- The value expressed in kernel units.public final boolean equivalent(IlvUnit unit)
true
if the specified unit is equivalent to this
one. Two units are equivalent if they have the same meters per unit.equivalent
in class IlvUnit
unit
- The unit to compare to.true
if the two units are equivalent.public final IlvUnit copy()
IlvLinearUnit
.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.