com.ionetrics.lib.annotatorcomm
Class MicrosecondTimestamp

java.lang.Object
  extended by com.ionetrics.lib.annotatorcomm.Timestamp
      extended by com.ionetrics.lib.annotatorcomm.MicrosecondTimestamp
All Implemented Interfaces:
java.lang.Comparable<Timestamp>
Direct Known Subclasses:
TriggerTimestamp

public class MicrosecondTimestamp
extends Timestamp

MicrosecondTimestamp is a timestamp accurate to within a microsecond. It is the standard time keeping Timestamp within libAnnotatorComm.


Field Summary
protected  int dayOfYear
          Timestamp day of year
protected  int microsecond
          Timestamp microsecond
protected  int secondOfDay
          Timestamp second of day
protected  int year
          Timestamp year
 
Constructor Summary
MicrosecondTimestamp(int year, int dayOfYear, int secondOfDay, int microsecond)
          Construct a MicrosecondTimestamp.
 
Method Summary
 int getDayOfYear()
          Get the day of year.
 int getMicrosecond()
          Get the microsecond of the second.
 int getSecondOfDay()
          Get the second of the day.
 int getYear()
          Get the year.
static MicrosecondTimestamp makeTimestamp(byte[] timestamp, int offset)
          Make a MicrosecondTimestamp from a set of bytes.
 
Methods inherited from class com.ionetrics.lib.annotatorcomm.Timestamp
compareTo, equals, getExtendedFormatTime, getFormattedTime, getHourOfDay, getMinuteOfHour, getSecondOfMinute, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

year

protected int year
Timestamp year


dayOfYear

protected int dayOfYear
Timestamp day of year


secondOfDay

protected int secondOfDay
Timestamp second of day


microsecond

protected int microsecond
Timestamp microsecond

Constructor Detail

MicrosecondTimestamp

public MicrosecondTimestamp(int year,
                            int dayOfYear,
                            int secondOfDay,
                            int microsecond)
Construct a MicrosecondTimestamp.

Parameters:
year - timestamp year
dayOfYear - timestamp day of year
secondOfDay - timestamp second of day
microsecond - timestamp microsecond
Method Detail

getYear

public int getYear()
Get the year.

Specified by:
getYear in class Timestamp
Returns:
year

getDayOfYear

public int getDayOfYear()
Get the day of year.

Specified by:
getDayOfYear in class Timestamp
Returns:
day

getSecondOfDay

public int getSecondOfDay()
Get the second of the day.

Specified by:
getSecondOfDay in class Timestamp
Returns:
second

getMicrosecond

public int getMicrosecond()
Get the microsecond of the second.

Specified by:
getMicrosecond in class Timestamp
Returns:
microsecond

makeTimestamp

public static MicrosecondTimestamp makeTimestamp(byte[] timestamp,
                                                 int offset)
Make a MicrosecondTimestamp from a set of bytes.
 typedef struct
 {
   uint16_t year;
   uint16_t dayofyear;
   uint32_t secondofday;
 } realtimeclock_t;
 uint32_t microsecond;
 

Parameters:
timestamp - raw timestamp bytes
offset - offset into raw bytes
Returns:
microsecond timestamp


Copyright © 2006 Ionetrics Corp. All Rights Reserved.