org.apache.directory.server.ntp.messages
Class NtpTimeStamp

java.lang.Object
  extended by org.apache.directory.server.ntp.messages.NtpTimeStamp

public class NtpTimeStamp
extends java.lang.Object

NTP timestamps are represented as a 64-bit unsigned fixed-point number, in seconds relative to 0h on 1 January 1900. The integer part is in the first 32 bits and the fraction part in the last 32 bits. In the fraction part, the non-significant low order can be set to 0.

Version:
$Rev: 547539 $, $Date: 2007-06-15 08:08:06 +0200 (Fri, 15 Jun 2007) $
Author:
Apache Directory Project

Constructor Summary
NtpTimeStamp()
          Creates a new instance of NtpTimeStamp that represents the time "right now."
NtpTimeStamp(java.nio.ByteBuffer data)
          Creates a new instance of NtpTimeStamp from encoded data in a ByteBuffer.
NtpTimeStamp(java.util.Date date)
          Creates a new instance of NtpTimeStamp that represents the given Date.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.lang.String toString()
           
 void writeTo(java.nio.ByteBuffer buffer)
          Writes this NtpTimeStamp to the given ByteBuffer.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NtpTimeStamp

public NtpTimeStamp()
Creates a new instance of NtpTimeStamp that represents the time "right now."


NtpTimeStamp

public NtpTimeStamp(java.util.Date date)
Creates a new instance of NtpTimeStamp that represents the given Date.

Parameters:
date -

NtpTimeStamp

public NtpTimeStamp(java.nio.ByteBuffer data)
Creates a new instance of NtpTimeStamp from encoded data in a ByteBuffer.

Parameters:
data -
Method Detail

writeTo

public void writeTo(java.nio.ByteBuffer buffer)
Writes this NtpTimeStamp to the given ByteBuffer.

Parameters:
buffer -

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object


Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.