org.jscience.net.ntp
Class TimeStamp

java.lang.Object
  extended by org.jscience.net.ntp.TimeStamp

public class TimeStamp
extends java.lang.Object

This class encapsulates the notion of a timestamp as in rfc2030. Logically it is the number of seconds since the beginning of the centure (in UTC time). It is represented as an 8 byte array, the first four bytes representing seconds and the next 4 bytes representing second fractions.


Field Summary
static TimeStamp zero
          The timestamp corresponding to the beginning of the century.
 
Constructor Summary
TimeStamp()
          This constructs a timestamp initialized with the current date.
TimeStamp(byte[] data)
          This constructs a timestamp starting from an eight byte array.
TimeStamp(java.util.Date date)
          This constructs a timestamp initialized with a given date.
 
Method Summary
 boolean equals(TimeStamp ts)
          Checks for equality of two timestamps.
 byte[] getData()
          Returns the eight byte array associated to a timestamp.
 java.util.Date getTime()
          Returns the date associated to a timestamp.
 java.lang.String toString()
          DOCUMENT ME!
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

zero

public static final TimeStamp zero
The timestamp corresponding to the beginning of the century.

Constructor Detail

TimeStamp

public TimeStamp()
This constructs a timestamp initialized with the current date.


TimeStamp

public TimeStamp(java.util.Date date)
This constructs a timestamp initialized with a given date.

Parameters:
date - DOCUMENT ME!

TimeStamp

public TimeStamp(byte[] data)
This constructs a timestamp starting from an eight byte array.

Parameters:
data - DOCUMENT ME!
Method Detail

equals

public boolean equals(TimeStamp ts)
Checks for equality of two timestamps.

Parameters:
ts - DOCUMENT ME!
Returns:
DOCUMENT ME!

toString

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

Overrides:
toString in class java.lang.Object
Returns:
DOCUMENT ME!

getData

public byte[] getData()
Returns the eight byte array associated to a timestamp.

Returns:
DOCUMENT ME!

getTime

public java.util.Date getTime()
Returns the date associated to a timestamp.

Returns:
DOCUMENT ME!