org.opengts.dbtypes
Class DTELogState

java.lang.Object
  extended by org.opengts.dbtools.DBFieldType
      extended by org.opengts.dbtypes.DTELogState

public class DTELogState
extends DBFieldType


Field Summary
static double DFT_distanceKM
           
static boolean DFT_isDriving
           
static GeoPoint DFT_lastGeoPoint
           
static int DFT_lastStatusCode
           
static long DFT_lastTimestamp
           
static java.lang.String KEY_distanceKM
           
static java.lang.String KEY_isDriving
           
static java.lang.String KEY_lastGeoPoint
           
static java.lang.String KEY_lastStatusCode
           
static java.lang.String KEY_lastTimestamp
           
 
Constructor Summary
DTELogState()
          Default constructor (disabled)
DTELogState(long lastTS, int lastSC, boolean isDriving, double distKM, GeoPoint lastGP)
          Constructor
DTELogState(java.sql.ResultSet rs, java.lang.String fldName)
          [DBFieldType interface] Constructor
DTELogState(RTProperties rtp)
          Constructor
DTELogState(java.lang.String rtpStr)
          Constructor
 
Method Summary
 void addLastDistanceKM(double deltaKM)
          Adds the specified distance to the accumulator, in Kilometers
 void addLastDistanceMI(double deltaMI)
          Adds the specified distance to the accumulator, in Miles
 void clear()
          Clears all values to their default
 boolean equals(java.lang.Object other)
          Returns true if the specified Object is equal to this instance
 boolean getIsDriving()
          Gets the driving state
 double getLastDistanceKM()
          Gets the distance travelled, in Kilometers
 double getLastDistanceMI()
          Gets the distance travelled, in Miles
 GeoPoint getLastGeoPoint()
          Gets the last GeoPoint.
 int getLastStatusCode()
          Gets the last status-code
 long getLastTimestamp()
          Gets the last timestamp
 java.lang.Object getObject()
          [DBFieldType interface] Return Object as saved in the DB
 RTProperties getRTProperties()
          Gets the RTProperties representation of this instance
 boolean hasLastGeoPoint()
          Returns true if the last GeoPoint is defined/valid
 boolean hasLastStatusCode()
          Returns true if the last status-code is defined
 boolean hasLastTimestamp()
          Returns true if last timestamp is defined
 void init(RTProperties rtp)
          Initializes values
static void main(java.lang.String[] argv)
           
 void setIsDriving(boolean isDriving)
          Sets the driving state
 void setLastDistanceKM(double distKM)
          Sets the distance travelled, in Kilometers
 void setLastDistanceMI(double distMI)
          Sets the distance travelled, in Miles
 void setLastEventData(EventData ev)
          Set Last timestamp and status-code per specified EventData instance
 void setLastGeoPoint(GeoPoint lastGP)
          Sets the last GeoPoint.
 void setLastStatusCode(int lastSC)
          Sets the last status-code
 void setLastTimestamp(long lastTS)
          Sets the last timestamp
 java.lang.String toString()
          Gets the String representation of this instance
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

KEY_lastTimestamp

public static final java.lang.String KEY_lastTimestamp
See Also:
Constant Field Values

KEY_lastStatusCode

public static final java.lang.String KEY_lastStatusCode
See Also:
Constant Field Values

KEY_isDriving

public static final java.lang.String KEY_isDriving
See Also:
Constant Field Values

KEY_distanceKM

public static final java.lang.String KEY_distanceKM
See Also:
Constant Field Values

KEY_lastGeoPoint

public static final java.lang.String KEY_lastGeoPoint
See Also:
Constant Field Values

DFT_lastTimestamp

public static final long DFT_lastTimestamp
See Also:
Constant Field Values

DFT_lastStatusCode

public static final int DFT_lastStatusCode
See Also:
Constant Field Values

DFT_isDriving

public static final boolean DFT_isDriving
See Also:
Constant Field Values

DFT_distanceKM

public static final double DFT_distanceKM
See Also:
Constant Field Values

DFT_lastGeoPoint

public static final GeoPoint DFT_lastGeoPoint
Constructor Detail

DTELogState

public DTELogState()
Default constructor (disabled)


DTELogState

public DTELogState(RTProperties rtp)
Constructor


DTELogState

public DTELogState(java.lang.String rtpStr)
Constructor


DTELogState

public DTELogState(long lastTS,
                   int lastSC,
                   boolean isDriving,
                   double distKM,
                   GeoPoint lastGP)
Constructor


DTELogState

public DTELogState(java.sql.ResultSet rs,
                   java.lang.String fldName)
            throws java.sql.SQLException
[DBFieldType interface] Constructor

Throws:
java.sql.SQLException
Method Detail

init

public void init(RTProperties rtp)
Initializes values


clear

public void clear()
Clears all values to their default


getLastTimestamp

public long getLastTimestamp()
Gets the last timestamp


setLastTimestamp

public void setLastTimestamp(long lastTS)
Sets the last timestamp


hasLastTimestamp

public boolean hasLastTimestamp()
Returns true if last timestamp is defined


getLastStatusCode

public int getLastStatusCode()
Gets the last status-code


setLastStatusCode

public void setLastStatusCode(int lastSC)
Sets the last status-code


hasLastStatusCode

public boolean hasLastStatusCode()
Returns true if the last status-code is defined


setLastEventData

public void setLastEventData(EventData ev)
Set Last timestamp and status-code per specified EventData instance


getIsDriving

public boolean getIsDriving()
Gets the driving state


setIsDriving

public void setIsDriving(boolean isDriving)
Sets the driving state


getLastDistanceKM

public double getLastDistanceKM()
Gets the distance travelled, in Kilometers


setLastDistanceKM

public void setLastDistanceKM(double distKM)
Sets the distance travelled, in Kilometers


addLastDistanceKM

public void addLastDistanceKM(double deltaKM)
Adds the specified distance to the accumulator, in Kilometers


getLastDistanceMI

public double getLastDistanceMI()
Gets the distance travelled, in Miles


setLastDistanceMI

public void setLastDistanceMI(double distMI)
Sets the distance travelled, in Miles


addLastDistanceMI

public void addLastDistanceMI(double deltaMI)
Adds the specified distance to the accumulator, in Miles


hasLastGeoPoint

public boolean hasLastGeoPoint()
Returns true if the last GeoPoint is defined/valid


getLastGeoPoint

public GeoPoint getLastGeoPoint()
Gets the last GeoPoint. Will return null if not defined/specified/invalid


setLastGeoPoint

public void setLastGeoPoint(GeoPoint lastGP)
Sets the last GeoPoint.


getRTProperties

public RTProperties getRTProperties()
Gets the RTProperties representation of this instance


toString

public java.lang.String toString()
Gets the String representation of this instance

Specified by:
toString in class DBFieldType
Returns:
The String representation of the current value

getObject

public java.lang.Object getObject()
[DBFieldType interface] Return Object as saved in the DB

Specified by:
getObject in class DBFieldType
Returns:
The current value

equals

public boolean equals(java.lang.Object other)
Returns true if the specified Object is equal to this instance

Overrides:
equals in class DBFieldType
Parameters:
other - The 'other' object
Returns:
True if the 'other' object is equivalent to this field type value

main

public static void main(java.lang.String[] argv)