its.backbone.domain.tms
Class TmsData

java.lang.Object
  extended byits.backbone.domain.SensorData
      extended byits.backbone.domain.tms.TmsData
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
TmsLoop, TmsStation, TmsTrap

public abstract class TmsData
extends SensorData

Base class for TMS data types TmsLoop, TmsStation, TmsTrap. These all use packed binary data formats defined by the TMS. These classes only provide the ability to construct an instance from a data block and an offset, which is how data is obtained from the TMS. They do not construct an instance from a stream. Last change: NSF 31 Dec 97 10:07 am

See Also:
Serialized Form

Field Summary
static int INCIDENT_CONTINUING
          value for incidentDetect meaning a previous incident is continuing
static int INCIDENT_NONE
          value for incidentDetect meaning no incident
static int INCIDENT_OCCURRED
          value for incidentDetect meaning an incident occurred
static int INCIDENT_TENTATIVE
          value for incidentDetect meaning an incident may have occurred
 
Fields inherited from class its.backbone.domain.SensorData
dataBlock, MASK_EIGHT_BIT, MASK_FIVE_BIT, MASK_FOUR_BIT, MASK_ONE_BIT, MASK_SEVEN_BIT, MASK_SIX_BIT, MASK_THREE_BIT, MASK_TWO_BIT, rawData
 
Constructor Summary
TmsData(DataBlock dataBlock, int packedsize)
          constructor
 
Method Summary
protected  void checkOffsetBounds(int offset)
          checks offset against the header size and the data block size, called by read.
abstract  java.lang.String getName()
           
abstract  TmsTimestamp getTimestamp()
           
abstract  boolean isValid()
           
protected abstract  void read(int offset)
          Method to read object from raw TMS data block.
 
Methods inherited from class its.backbone.domain.SensorData
getPackedSize, processSensor, setRawData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INCIDENT_NONE

public static final int INCIDENT_NONE
value for incidentDetect meaning no incident

See Also:
Constant Field Values

INCIDENT_TENTATIVE

public static final int INCIDENT_TENTATIVE
value for incidentDetect meaning an incident may have occurred

See Also:
Constant Field Values

INCIDENT_OCCURRED

public static final int INCIDENT_OCCURRED
value for incidentDetect meaning an incident occurred

See Also:
Constant Field Values

INCIDENT_CONTINUING

public static final int INCIDENT_CONTINUING
value for incidentDetect meaning a previous incident is continuing

See Also:
Constant Field Values
Constructor Detail

TmsData

public TmsData(DataBlock dataBlock,
               int packedsize)
        throws java.lang.IllegalArgumentException
constructor

Parameters:
dataBlock - the block of data
Throws:
java.lang.IllegalArgumentException
BadOffsetException - Last change: NSF 5 Dec 97 1:56 pm
Method Detail

getName

public abstract java.lang.String getName()

getTimestamp

public abstract TmsTimestamp getTimestamp()

isValid

public abstract boolean isValid()
Specified by:
isValid in class SensorData

read

protected abstract void read(int offset)
                      throws BadOffsetException
Method to read object from raw TMS data block. The number of bytes to read is inherent in the sensor type (loop or station are 3 bytes, speed trap is 6 bytes).

Specified by:
read in class SensorData
Parameters:
offset - the offset at which to start reading
Throws:
BadOffsetException - if the offset < TmsData.HEADER_LENGTH or >= the length of the data block

checkOffsetBounds

protected void checkOffsetBounds(int offset)
                          throws BadOffsetException
checks offset against the header size and the data block size, called by read.

Specified by:
checkOffsetBounds in class SensorData
Throws:
BadOffsetException - if offset < HEADER_SIZE or offset >= (data block size - size of sensor).