类 Measurement
java.lang.Object
net.sf.marineapi.nmea.util.Measurement
Sensor measurement data delivered by
XDRSentence. Notice that any of the
fields may be empty (null), depending on sentence and sensor
that produced it.- 作者:
- Robert Huitema, Kimmo Tuukkanen
-
构造器概要
构造器构造器说明Creates a new empty instance of Measurement.Measurement(String type, double value, String units, String name) Creates a new instance of Measurement with given values. -
方法概要
修饰符和类型方法说明getName()Returns the name of transducer.getType()Returns the type of transducer.getUnits()Returns the units of measurement.doublegetValue()Returns the measurement value.booleanisEmpty()Tells if all fields in this measurement are empty (null).voidSets the name of transducer.voidSets the type of measurement.voidSets the units of measurement.voidsetValue(double value) Sets the measurement value.
-
构造器详细资料
-
Measurement
public Measurement()Creates a new empty instance of Measurement. -
Measurement
Creates a new instance of Measurement with given values.- 参数:
type- Type of measurementvalue- The measured valueunits- Unit of measurementname- Name of measurement
-
-
方法详细资料
-
getName
Returns the name of transducer.- 返回:
- Sensor name String
-
getType
Returns the type of transducer.- 返回:
- Type String
-
getUnits
Returns the units of measurement.- 返回:
- Units String
-
getValue
public double getValue()Returns the measurement value.- 返回:
- Double value
-
setName
Sets the name of transducer.- 参数:
name- Transducer name to set
-
setType
Sets the type of measurement.- 参数:
type- Type to set
-
setUnits
Sets the units of measurement.- 参数:
units- Units to set.
-
setValue
public void setValue(double value) Sets the measurement value.- 参数:
value- Value to set
-
isEmpty
public boolean isEmpty()Tells if all fields in this measurement are empty (null).- 返回:
- true if empty, otherwise false.
-