类 Measurement

java.lang.Object
net.sf.marineapi.nmea.util.Measurement

public class Measurement extends Object
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
  • 构造器详细资料

    • Measurement

      public Measurement()
      Creates a new empty instance of Measurement.
    • Measurement

      public Measurement(String type, double value, String units, String name)
      Creates a new instance of Measurement with given values.
      参数:
      type - Type of measurement
      value - The measured value
      units - Unit of measurement
      name - Name of measurement
  • 方法详细资料

    • getName

      public String getName()
      Returns the name of transducer.
      返回:
      Sensor name String
    • getType

      public String getType()
      Returns the type of transducer.
      返回:
      Type String
    • getUnits

      public String getUnits()
      Returns the units of measurement.
      返回:
      Units String
    • getValue

      public double getValue()
      Returns the measurement value.
      返回:
      Double value
    • setName

      public void setName(String name)
      Sets the name of transducer.
      参数:
      name - Transducer name to set
    • setType

      public void setType(String type)
      Sets the type of measurement.
      参数:
      type - Type to set
    • setUnits

      public void setUnits(String units)
      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.