| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.date.AtomicClock
public class AtomicClock
Get the time from the NIST atomic clock
| 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 | 
|---|
public AtomicClock()
| Method Detail | 
|---|
public static java.io.BufferedReader getReader()
                                        throws java.net.UnknownHostException,
                                               java.io.IOException
java.net.UnknownHostException - It cannot connect to NIST
java.io.IOException - When we cannot set the time
public static void setSystemTime(java.util.GregorianCalendar c)
                          throws java.io.IOException
c - A calender instance that is used to set the time
java.io.IOException - When we cannot set the timepublic static java.util.GregorianCalendar parseDate(java.lang.String line)
line - The raw string returned from NIST
public static void processLine(java.lang.String s)
                        throws java.io.IOException
s - 
java.io.IOException
public static void getTime()
                    throws java.net.UnknownHostException,
                           java.io.IOException
java.net.UnknownHostException
java.io.IOExceptionpublic static void sleep()
public static void main(java.lang.String[] args)
args - not used| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||