org.jscience.devices.gps.garmin
Class LapDataPacket

java.lang.Object
  extended by org.jscience.devices.gps.garmin.GarminPacket
      extended by org.jscience.devices.gps.garmin.LapDataPacket
All Implemented Interfaces:
ILap

public class LapDataPacket
extends GarminPacket
implements ILap

This class encapsulates a lap-packet.


Field Summary
protected  boolean bound
          DOCUMENT ME!
protected  int calories
          calories
protected static int datatypeversion
          Holds information about which lap-format this Garmin-unit uses.
protected  long start_time
          start time
protected  float total_distance
          total_distance
protected  long total_time
          total time
protected  short track_index
          track index
protected  short unused
          unused
 
Fields inherited from class org.jscience.devices.gps.garmin.GarminPacket
Cmnd_Abort_Transfer, Cmnd_Start_Pvt_Data, Cmnd_Stop_Pvt_Data, Cmnd_Transfer_Alm, Cmnd_Transfer_Laps, Cmnd_Transfer_Posn, Cmnd_Transfer_Prx, Cmnd_Transfer_Rte, Cmnd_Transfer_Time, Cmnd_Transfer_Trk, Cmnd_Transfer_Wpt, Cmnd_Turn_Off_Pwr, DLE, ETX, packet, Pid_Ack_Byte, Pid_Command_Data, Pid_Date_Time_Data, Pid_Lap, Pid_Nak_Byte, Pid_Position_Data, Pid_Product_Data, Pid_Product_Rqst, Pid_Protocol_Array, Pid_Prx_Wpt_Data, Pid_Pvt_Data, Pid_Records, Pid_Trk_data, Pid_Trk_Hdr, Pid_Wpt_Data, Pid_Xfer_Cmplt, pointer
 
Constructor Summary
LapDataPacket(GarminPacket p)
          Creates a new LapDataPacket object.
LapDataPacket(int[] p)
          Throws a PacketNotRecognizedException if the lap-dataformat is not implemented.
 
Method Summary
 int getCalories()
          calories
 Position getEndPosition()
          end point
 Position getStartPosition()
          begin point
 long getStartTime()
          DOCUMENT ME!
 float getTotalDistance()
          total_distance
 long getTotalTime()
          total time
 short getTrackIndex()
          track index
static void setDatatypeVersion(int v)
          Sets which version of the packet that this class should treat.
 java.lang.String toString()
          DOCUMENT ME!
 
Methods inherited from class org.jscience.devices.gps.garmin.GarminPacket
calcChecksum, createBasicPacket, createCommandPacket, getByte, getDataLength, getID, getLength, getPacket, getPointer, getRawPacket, idToString, isLegal, readBoolean, readBoolean, readByte, readByte, readDouble, readDouble, readFloat, readFloat, readLong, readLong, readNullTerminatedString, readNullTerminatedString, readPosition, readPosition, readWord, readWord, setPointer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

datatypeversion

protected static int datatypeversion
Holds information about which lap-format this Garmin-unit uses. The default is 108.


bound

protected boolean bound
DOCUMENT ME!


start_time

protected long start_time
start time


total_time

protected long total_time
total time


total_distance

protected float total_distance
total_distance


calories

protected int calories
calories


track_index

protected short track_index
track index


unused

protected short unused
unused

Constructor Detail

LapDataPacket

public LapDataPacket(int[] p)
Throws a PacketNotRecognizedException if the lap-dataformat is not implemented.

Parameters:
p - DOCUMENT ME!

LapDataPacket

public LapDataPacket(GarminPacket p)
Creates a new LapDataPacket object.

Parameters:
p - DOCUMENT ME!
Method Detail

setDatatypeVersion

public static void setDatatypeVersion(int v)
Sets which version of the packet that this class should treat.
Note: Setting this value will affect all instances of the class.

Parameters:
v - DOCUMENT ME!

toString

public java.lang.String toString()
DOCUMENT ME!

Overrides:
toString in class GarminPacket
Returns:
DOCUMENT ME!

getStartTime

public long getStartTime()
Description copied from interface: ILap
DOCUMENT ME!

Specified by:
getStartTime in interface ILap
Returns:
DOCUMENT ME!

getTotalTime

public long getTotalTime()
Description copied from interface: ILap
total time

Specified by:
getTotalTime in interface ILap
Returns:
DOCUMENT ME!

getTotalDistance

public float getTotalDistance()
Description copied from interface: ILap
total_distance

Specified by:
getTotalDistance in interface ILap
Returns:
DOCUMENT ME!

getStartPosition

public Position getStartPosition()
Description copied from interface: ILap
begin point

Specified by:
getStartPosition in interface ILap
Returns:
DOCUMENT ME!

getEndPosition

public Position getEndPosition()
Description copied from interface: ILap
end point

Specified by:
getEndPosition in interface ILap
Returns:
DOCUMENT ME!

getCalories

public int getCalories()
Description copied from interface: ILap
calories

Specified by:
getCalories in interface ILap
Returns:
DOCUMENT ME!

getTrackIndex

public short getTrackIndex()
Description copied from interface: ILap
track index

Specified by:
getTrackIndex in interface ILap
Returns:
DOCUMENT ME!