net.date
Class AtomicClock

java.lang.Object
  extended by net.date.AtomicClock

public class AtomicClock
extends java.lang.Object

Get the time from the NIST atomic clock

Version:
1.0
Author:
Douglas Lyon

Constructor Summary
AtomicClock()
           
 
Method Summary
static java.io.BufferedReader getReader()
          get a reader that reads the time
static void getTime()
          Reads in the time to internal state variables
static void main(java.lang.String[] args)
          A unit test
static java.util.GregorianCalendar parseDate(java.lang.String line)
          Convert the NIST time to an instance of a calendar
static void processLine(java.lang.String s)
           
static void setSystemTime(java.util.GregorianCalendar c)
          set the system clock
static void sleep()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AtomicClock

public AtomicClock()
Method Detail

getReader

public static java.io.BufferedReader getReader()
                                        throws java.net.UnknownHostException,
                                               java.io.IOException
get a reader that reads the time

Returns:
the buffered reader
Throws:
java.net.UnknownHostException - It cannot connect to NIST
java.io.IOException - When we cannot set the time
Since:
9/4/02

setSystemTime

public static void setSystemTime(java.util.GregorianCalendar c)
                          throws java.io.IOException
set the system clock

Parameters:
c - A calender instance that is used to set the time
Throws:
java.io.IOException - When we cannot set the time
Since:
9/4/02

parseDate

public static java.util.GregorianCalendar parseDate(java.lang.String line)
Convert the NIST time to an instance of a calendar

Parameters:
line - The raw string returned from NIST
Returns:
a calendar instance

processLine

public static void processLine(java.lang.String s)
                        throws java.io.IOException
Parameters:
s -
Throws:
java.io.IOException

getTime

public static void getTime()
                    throws java.net.UnknownHostException,
                           java.io.IOException
Reads in the time to internal state variables

Throws:
java.net.UnknownHostException
java.io.IOException

sleep

public static void sleep()

main

public static void main(java.lang.String[] args)
A unit test

Parameters:
args - not used
Since:
1.0