org.jscience.devices.gps.garmin
Class TimeDataPacket

java.lang.Object
  extended by org.jscience.devices.gps.garmin.GarminPacket
      extended by org.jscience.devices.gps.garmin.TimeDataPacket
All Implemented Interfaces:
IDate, ITime

public class TimeDataPacket
extends GarminPacket
implements ITime, IDate

This class encapsulates the information of a Garmin-Date-Time-packet.


Field Summary
protected  short day
          Day (1-31)
protected  int hour
          Hour of the day.
protected  short minute
          Minute of the hour.
protected  short month
          Month (1-12)
protected  short second
          Second of the minute.
protected  int year
          Year.
 
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
TimeDataPacket(GarminPacket p)
          Treats the packet p as a packet containing Time-data.
TimeDataPacket(int[] p)
          Treats the packet p as a packet containing Time-data.
 
Method Summary
 short getDay()
          Returns the day of the month.
 int getHours()
          Returns the hour of the day.
 short getMinutes()
          Returns the minute of the hour.
 short getMonth()
          Returns the month.
 short getSeconds()
          Returns the second of the minute.
 int getYear()
          returns the year.
 java.lang.String toString()
          Returns the value of this packet in a human-readable format.
 
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

month

protected short month
Month (1-12)


day

protected short day
Day (1-31)


year

protected int year
Year.


hour

protected int hour
Hour of the day.


minute

protected short minute
Minute of the hour.


second

protected short second
Second of the minute.

Constructor Detail

TimeDataPacket

public TimeDataPacket(int[] p)
Treats the packet p as a packet containing Time-data. Throws PacketNotRecognizedException if p is not a Time-packet. Throws InvalidPacketException if the packet contains too little data.

Parameters:
p - DOCUMENT ME!

TimeDataPacket

public TimeDataPacket(GarminPacket p)
Treats the packet p as a packet containing Time-data. Throws PacketNotRecognizedException if p is not a Time-packet. Throws InvalidPacketException if the packet contains too little data.

Parameters:
p - DOCUMENT ME!
Method Detail

getDay

public short getDay()
Returns the day of the month.

Specified by:
getDay in interface IDate
Returns:
DOCUMENT ME!

getMonth

public short getMonth()
Returns the month.

Specified by:
getMonth in interface IDate
Returns:
DOCUMENT ME!

getYear

public int getYear()
returns the year.

Specified by:
getYear in interface IDate
Returns:
DOCUMENT ME!

getHours

public int getHours()
Returns the hour of the day.

Specified by:
getHours in interface ITime
Returns:
DOCUMENT ME!

getMinutes

public short getMinutes()
Returns the minute of the hour.

Specified by:
getMinutes in interface ITime
Returns:
DOCUMENT ME!

getSeconds

public short getSeconds()
Returns the second of the minute.

Specified by:
getSeconds in interface ITime
Returns:
DOCUMENT ME!

toString

public java.lang.String toString()
Returns the value of this packet in a human-readable format.

Overrides:
toString in class GarminPacket
Returns:
DOCUMENT ME!