gov.nasa.gsfc.drl.rtstps.core.output.hdf5
Class CDSPacketTime

java.lang.Object
  extended by gov.nasa.gsfc.drl.rtstps.core.output.hdf5.CDSPacketTime

public class CDSPacketTime
extends java.lang.Object

A helper class for working with a segmented time of 16 bits of day, 32 bits of milliseconds and 16 bits micros


Field Summary
private  long days
           
static long JavaToTIA_InMillis
           
private  long micros
           
private  long millis
           
private  long time
           
 
Constructor Summary
CDSPacketTime(long timeStamp)
          Give a packet and pull out the raw time stamp field The user is expected to know the packet has a time stamp
 
Method Summary
 java.util.Date getDate()
          Return a Date of the time.
 long getDays()
          Return the day count
 long getMicros()
          Return the micros count
 long getMillis()
          Return the millis count
 long getTime()
          Return the entire time field which is 64-bits, use it as an unsigned value.
 java.lang.String toString()
          Return a comma delimited string of "[Days=xxx], [Millis=yyy], [Micros=zzz]"
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

JavaToTIA_InMillis

public static final long JavaToTIA_InMillis
See Also:
Constant Field Values

days

private long days

millis

private long millis

micros

private long micros

time

private long time
Constructor Detail

CDSPacketTime

public CDSPacketTime(long timeStamp)
Give a packet and pull out the raw time stamp field The user is expected to know the packet has a time stamp

Parameters:
timeStamp - the 64-bit timestamp from the packet
Method Detail

getDays

public long getDays()
Return the day count

Returns:
day count in a long

getMillis

public long getMillis()
Return the millis count

Returns:
millis count in a long

getMicros

public long getMicros()
Return the micros count

Returns:
micros count in a long

getTime

public long getTime()
Return the entire time field which is 64-bits, use it as an unsigned value. Since Java long is signed, some care must be taken in this regard.

Returns:
the 64-bit time field as a long

getDate

public java.util.Date getDate()
Return a Date of the time. The time is converted to a PDSDate internally which handles all the epoch conversion stuff and timezone issues, and then from that is converted to a Date.

Returns:
date and time represented in a Date

toString

public java.lang.String toString()
Return a comma delimited string of "[Days=xxx], [Millis=yyy], [Micros=zzz]"

Overrides:
toString in class java.lang.Object