net.sf.marineapi.nmea.util
Class Measurement

java.lang.Object
  extended by 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.

Author:
Robert Huitema, Kimmo Tuukkanen

Constructor Summary
Measurement()
          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.
 
Method Summary
 String getName()
          Returns the name of transducer.
 String getType()
          Returns the type of transducer.
 String getUnits()
          Returns the units of measurement.
 double getValue()
          Returns the measurement value.
 boolean isEmpty()
          Tells if all fields in this measurement are empty (null).
 void setName(String name)
          Sets the name of transducer.
 void setType(String type)
          Sets the type of measurement.
 void setUnits(String units)
          Sets the units of measurement.
 void setValue(double value)
          Sets the measurement value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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.

Method Detail

getName

public String getName()
Returns the name of transducer.

Returns:
Sensor name String

getType

public String getType()
Returns the type of transducer.

Returns:
Type String

getUnits

public String getUnits()
Returns the units of measurement.

Returns:
Units String

getValue

public double getValue()
Returns the measurement value.

Returns:
Double value

setName

public void setName(String name)
Sets the name of transducer.

Parameters:
name - Transducer name to set

setType

public void setType(String type)
Sets the type of measurement.

Parameters:
type - Type to set

setUnits

public void setUnits(String units)
Sets the units of measurement.

Parameters:
units - Units to set.

setValue

public void setValue(double value)
Sets the measurement value.

Parameters:
value - Value to set

isEmpty

public boolean isEmpty()
Tells if all fields in this measurement are empty (null).

Returns:
true if empty, otherwise false.


Copyright (C) 2010-2014 Java Marine API authors. All Rights Reserved.