de.unikassel.android.sdcframework.devices
Class TimeProviderDevice

Package class diagram package TimeProviderDevice
java.lang.Object
  extended by de.unikassel.android.sdcframework.devices.AbstractSensorDevice
      extended by de.unikassel.android.sdcframework.devices.VirtualSensorDevice
          extended by de.unikassel.android.sdcframework.devices.TimeProviderDevice
All Implemented Interfaces:
SampleProvidingSensorDevice, SensorDevice, VisitableDevice, EventObserver<TimeProviderEvent>

public class TimeProviderDevice
extends VirtualSensorDevice
implements SampleProvidingSensorDevice, EventObserver<TimeProviderEvent>

Implementation of the the time provider synchronization state observing sensor device.


Field Summary
private  TimeProviderSampleData currentSampleData
          The actual sample of the device, updated whenever the handler for sensor changes is called
private  TimeInformation timeInfo
          The event time stamp and sync state.
 
Constructor Summary
TimeProviderDevice()
          Constructor
 
Method Summary
 boolean enableDeviceScanning(boolean enabled, Context context)
          Setter for device scanning enabled state
 Sample getSample()
          Getter for a device sample
 boolean hasSample()
          Test method for a sample available
 void onEvent(ObservableEventSource<? extends TimeProviderEvent> eventSource, TimeProviderEvent observedEvent)
          This method is called whenever the observed object does create an observed event
 
Methods inherited from class de.unikassel.android.sdcframework.devices.VirtualSensorDevice
doSignalDeviceNotEnabledInSystem, isDeviceInSystemEnabled, onConfigurationChanged
 
Methods inherited from class de.unikassel.android.sdcframework.devices.AbstractSensorDevice
accept, doHandleDeviceDisabledBySystem, doHandleDeviceEnabledBySystem, getConfiguration, getDeviceIdentifier, getScanner, isAirplaneModeOn, isDeviceScanningEnabled, onCreate, onDestroy, setDeviceIdentifier, setScanner, updateConfiguration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentSampleData

private final TimeProviderSampleData currentSampleData
The actual sample of the device, updated whenever the handler for sensor changes is called


timeInfo

private TimeInformation timeInfo
The event time stamp and sync state.

Constructor Detail

TimeProviderDevice

public TimeProviderDevice()
Constructor

Method Detail

enableDeviceScanning

public final boolean enableDeviceScanning(boolean enabled,
                                          Context context)
Description copied from interface: SensorDevice
Setter for device scanning enabled state

Specified by:
enableDeviceScanning in interface SensorDevice
Overrides:
enableDeviceScanning in class AbstractSensorDevice
Parameters:
enabled - true to enable device scanning, false to disable it
context - the application context
Returns:
true if successful enabled, false otherwise

getSample

public Sample getSample()
Description copied from interface: SampleProvidingSensorDevice
Getter for a device sample

Specified by:
getSample in interface SampleProvidingSensorDevice
Returns:
a sample of the device

hasSample

public boolean hasSample()
Description copied from interface: SampleProvidingSensorDevice
Test method for a sample available

Specified by:
hasSample in interface SampleProvidingSensorDevice
Returns:
true if a sample is available

onEvent

public void onEvent(ObservableEventSource<? extends TimeProviderEvent> eventSource,
                    TimeProviderEvent observedEvent)
Description copied from interface: EventObserver
This method is called whenever the observed object does create an observed event

Specified by:
onEvent in interface EventObserver<TimeProviderEvent>
Parameters:
eventSource - the event generator
observedEvent - the event created by the observed object