public interface

Measurement

com.openxc.measurements.Measurement
Known Indirect Subclasses

Class Overview

The Measurement is the base for all OpenXC measurements. A Measurement has at least a value and an age, and optionally a range of valid values.

Summary

Nested Classes
interface Measurement.Listener  
Public Methods
abstract long getAge()
Retreive the age of this measurement.
abstract long getBirthtime()
Return the creation time of this measurement;
abstract String getGenericName()
abstract String getName(Context context)
abstract Range<? extends Unit> getRange()
Retrieve the valid range of the measurement.
abstract Object getSerializedValue()
Return the value of this measurement as a type good for serialization.
abstract Unit getValue()
Return the value of this measurement.
abstract boolean hasRange()
Determine if this measurement has a valid range.
abstract void setTimestamp(long timestamp)
Set the birth timestamp for this measurement.
abstract SimpleVehicleMessage toVehicleMessage()

Public Methods

public abstract long getAge ()

Retreive the age of this measurement.

Returns
  • the age of the data in milliseconds.

public abstract long getBirthtime ()

Return the creation time of this measurement;

Returns
  • the creation time in milliseconds since the epoch of this measurement.

public abstract String getGenericName ()

public abstract String getName (Context context)

public abstract Range<? extends Unit> getRange ()

Retrieve the valid range of the measurement.

Returns
  • the Range of the measurement or null if none.

public abstract Object getSerializedValue ()

Return the value of this measurement as a type good for serialization.

Returns
  • something easily serializable - e.g. String, Double, Boolean.

public abstract Unit getValue ()

Return the value of this measurement.

Returns
  • The wrapped value (an instance of TheUnit)

public abstract boolean hasRange ()

Determine if this measurement has a valid range.

Returns
  • true if the measurement has a non-null range.

public abstract void setTimestamp (long timestamp)

Set the birth timestamp for this measurement.

Parameters
timestamp the new timestamp, in milliseconds since the epoch.

public abstract SimpleVehicleMessage toVehicleMessage ()