context.arch.widget
Class OffsetThread

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--context.arch.widget.OffsetThread

public class OffsetThread
extends java.lang.Thread

This class is responsible for retrieving and updating the offset between the local clock the component is running on and a "more accurate" global time clock


Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
OffsetThread()
          Empty constructor
OffsetThread(float seconds)
          Constructor that updates the offset between the local and global clock at a frequency of "seconds" seconds.
 
Method Summary
protected  long getCurrentOffset()
          This method contacts an network time protocol (ntp) server and determines the offset between the local and global clock
 void run()
          The run method for the Thread.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OffsetThread

public OffsetThread()
Empty constructor

OffsetThread

public OffsetThread(float seconds)
Constructor that updates the offset between the local and global clock at a frequency of "seconds" seconds.
Parameters:
seconds - Number of seconds between updates
Method Detail

run

public void run()
The run method for the Thread.
Overrides:
run in class java.lang.Thread

getCurrentOffset

protected long getCurrentOffset()
This method contacts an network time protocol (ntp) server and determines the offset between the local and global clock
Returns:
offset in milliseconds between the local and global clock