de.unikassel.android.sdcframework.devices
Class ProximityDevice

Package class diagram package ProximityDevice
java.lang.Object
  extended by de.unikassel.android.sdcframework.devices.AbstractSensorDevice
      extended by de.unikassel.android.sdcframework.devices.ScannerStateAwareSensorDevice
          extended by de.unikassel.android.sdcframework.devices.AbstractAndroidSensorDevice
              extended by de.unikassel.android.sdcframework.devices.SamplingCausingAndroidSensorDevice
                  extended by de.unikassel.android.sdcframework.devices.ProximityDevice
All Implemented Interfaces:
SampleProvidingSensorDevice, SensorDevice, VisitableDevice

public class ProximityDevice
extends SamplingCausingAndroidSensorDevice

Implementation of the proximity sensor device.


Field Summary
private  ProximitySampleData currentSampleData
          The actual sample of the device, updated whenever the handler for sensor changes is called
 
Constructor Summary
ProximityDevice(Context context)
          Constructor
 
Method Summary
protected  SampleData getCurrentSampleData()
          Getter for the current sample data
 boolean hasSample()
          Test method for a sample available
protected  boolean update(SensorEvent event)
          Method to update the sensor data
 
Methods inherited from class de.unikassel.android.sdcframework.devices.SamplingCausingAndroidSensorDevice
doHandleSensorChanged
 
Methods inherited from class de.unikassel.android.sdcframework.devices.AbstractAndroidSensorDevice
doHandleSensorAccuracyChanged, doSignalDeviceNotEnabledInSystem, getListener, getSample, getSensor, isDeviceInSystemEnabled, onScannerRunningStateChange
 
Methods inherited from class de.unikassel.android.sdcframework.devices.ScannerStateAwareSensorDevice
enableDeviceScanning, 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 ProximitySampleData currentSampleData
The actual sample of the device, updated whenever the handler for sensor changes is called

Constructor Detail

ProximityDevice

public ProximityDevice(Context context)
Constructor

Parameters:
context - the context
Method Detail

getCurrentSampleData

protected final SampleData getCurrentSampleData()
Description copied from class: AbstractAndroidSensorDevice
Getter for the current sample data

Specified by:
getCurrentSampleData in class AbstractAndroidSensorDevice
Returns:
the current sample data

update

protected boolean update(SensorEvent event)
Description copied from class: SamplingCausingAndroidSensorDevice
Method to update the sensor data

Specified by:
update in class SamplingCausingAndroidSensorDevice
Parameters:
event - the sensor event to handle
Returns:
true if data have been updated, false otherwise

hasSample

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

Returns:
true if a sample is available