org.jscience.net.ntp
Class NtpHeader

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

public class NtpHeader
extends java.lang.Object

This class encapsulates the header of a NtpDatagram. See rfc2030 for more details.


Field Summary
static NtpHeader defaultHeader
          The default header for a client datagram.
static byte[] defaultHeaderData
          The default header data for a client datagram.
 
Constructor Summary
NtpHeader(byte[] data)
          Construct a NtpHeader from a 16 byte array.
 
Method Summary
 byte[] getData()
          Gets the 16 byte array constituting the header.
 int getLeapYearIndicator()
          DOCUMENT ME!
 int getMode()
          DOCUMENT ME!
 int getPollInterval()
          DOCUMENT ME!
 double getPrecision()
          Get precision in milliseconds.
 java.lang.Object getReferenceIdentifier()
          Gets the reference identifier as an object.
 double getRootDelay()
          Get root delay in milliseconds.
 double getRootDispersion()
          Get root dispersion in milliseconds.
 int getStratum()
          DOCUMENT ME!
 int getVersionNumber()
          DOCUMENT ME!
 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

defaultHeaderData

public static final byte[] defaultHeaderData
The default header data for a client datagram. Version=3, Mode=client.


defaultHeader

public static final NtpHeader defaultHeader
The default header for a client datagram. This is a wrapper around 'defaultHeaderData'

Constructor Detail

NtpHeader

public NtpHeader(byte[] data)
Construct a NtpHeader from a 16 byte array.

Parameters:
data - DOCUMENT ME!
Method Detail

getData

public byte[] getData()
Gets the 16 byte array constituting the header.

Returns:
DOCUMENT ME!

getLeapYearIndicator

public int getLeapYearIndicator()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getVersionNumber

public int getVersionNumber()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getMode

public int getMode()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getStratum

public int getStratum()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getPollInterval

public int getPollInterval()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getPrecision

public double getPrecision()
Get precision in milliseconds.

Returns:
DOCUMENT ME!

getRootDelay

public double getRootDelay()
Get root delay in milliseconds.

Returns:
DOCUMENT ME!

getRootDispersion

public double getRootDispersion()
Get root dispersion in milliseconds.

Returns:
DOCUMENT ME!

getReferenceIdentifier

public java.lang.Object getReferenceIdentifier()
Gets the reference identifier as an object. It can be either a String, a InetAddress or a 4 byte array. Use 'instanceof' to find out what the true class is.

Returns:
DOCUMENT ME!

toString

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

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