de.unikassel.android.sdcframework.util
Class TimeUpdateEvent

Package class diagram package TimeUpdateEvent
java.lang.Object
  extended by de.unikassel.android.sdcframework.util.AbstractTimeProviderEvent
      extended by de.unikassel.android.sdcframework.util.TimeUpdateEvent
All Implemented Interfaces:
BroadcastableEvent, ObservableEvent, TimeProviderEvent

public final class TimeUpdateEvent
extends AbstractTimeProviderEvent

The observable time update event. Used to signal state changes of the time provider and to distribute the time offset.


Field Summary
static String ACTION
          Out custom intent action.
(package private)  long offset
          The time stamp offset.
protected static String OFFSET
          The intent identifier for the message field.
 
Fields inherited from class de.unikassel.android.sdcframework.util.AbstractTimeProviderEvent
ts, TS
 
Constructor Summary
  TimeUpdateEvent(Intent intent)
          Constructor
private TimeUpdateEvent(long ts)
          Constructor
  TimeUpdateEvent(long ts, long offset)
          Constructor
 
Method Summary
protected  String getAction()
          Getter for the intent action.
 long getTimeOffset()
          Getter for the time offset
 boolean isSynced()
          Getter for the synchronization state.
protected  void putAdditionalExtras(Intent intent)
          Method to add extra information for intent creation.
 
Methods inherited from class de.unikassel.android.sdcframework.util.AbstractTimeProviderEvent
getIntent, getTimeStamp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTION

public static final String ACTION
Out custom intent action.

See Also:
Constant Field Values

OFFSET

protected static final String OFFSET
The intent identifier for the message field.

See Also:
Constant Field Values

offset

final long offset
The time stamp offset.

Constructor Detail

TimeUpdateEvent

private TimeUpdateEvent(long ts)
Constructor


TimeUpdateEvent

public TimeUpdateEvent(long ts,
                       long offset)
Constructor

Parameters:
ts - the time stamp *
offset - the time offset

TimeUpdateEvent

public TimeUpdateEvent(Intent intent)
Constructor

Parameters:
intent - the intent to create from
Method Detail

getTimeOffset

public final long getTimeOffset()
Getter for the time offset

Returns:
the time offset

isSynced

public boolean isSynced()
Description copied from interface: TimeProviderEvent
Getter for the synchronization state.

Returns:
true if synchronized by NTP provider

putAdditionalExtras

protected void putAdditionalExtras(Intent intent)
Description copied from class: AbstractTimeProviderEvent
Method to add extra information for intent creation.

Specified by:
putAdditionalExtras in class AbstractTimeProviderEvent
Parameters:
intent - the intent to add extras to

getAction

protected String getAction()
Description copied from class: AbstractTimeProviderEvent
Getter for the intent action.

Specified by:
getAction in class AbstractTimeProviderEvent
Returns:
the intent action.