de.unikassel.android.sdcframework.devices
Class SensorDeviceAvailabilityTester

Package class diagram package SensorDeviceAvailabilityTester
java.lang.Object
  extended by de.unikassel.android.sdcframework.devices.SensorDeviceAvailabilityTester

public final class SensorDeviceAvailabilityTester
extends Object

The global singleton to test for sensor device availability. With the first call to the {link configure(Set, Context) method, the availability of supported devices is tested and the identifiers will be stored to be queried later by a call to getAvailableSensorDevices().


Field Summary
private  boolean initialized
          flag if sensor device list is initialized
private static SensorDeviceAvailabilityTester instance
          The singleton instance of the sensor availability tester manager
private  Vector<SensorDeviceIdentifier> vecSensorDevices
          Vector to store the detected sensor devices
 
Constructor Summary
private SensorDeviceAvailabilityTester()
          Constructor
 
Method Summary
 void configure(Set<SensorDeviceIdentifier> configuredDevices, Context applicationContext)
          Method to inject the sensor devices from service configuration
private  void detectAvailableSensorDevices(Set<SensorDeviceIdentifier> configuredDevices, Context applicationContext)
          Does detect available sensor devices
 List<SensorDeviceIdentifier> getAvailableSensorDevices()
          Getter for available Sensor devices
static SensorDeviceAvailabilityTester getInstance()
          Access to the singleton instance of the preference manager
private  Vector<SensorDeviceIdentifier> getVecSensorDevices()
          Getter for the vecSensorDevices
private  boolean isDeviceAvailable(SensorDeviceIdentifier identifier, Context applicationContext)
          Test method for availability of a specific sensor device
 boolean isInitialized()
          Getter for the initialized
private  void setInitialized(boolean initialized)
          Setter for the initialized
private  void setVecSensorDevices(Vector<SensorDeviceIdentifier> vecSensorDevices)
          Setter for the vecSensorDevices
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

private static SensorDeviceAvailabilityTester instance
The singleton instance of the sensor availability tester manager


vecSensorDevices

private Vector<SensorDeviceIdentifier> vecSensorDevices
Vector to store the detected sensor devices


initialized

private boolean initialized
flag if sensor device list is initialized

Constructor Detail

SensorDeviceAvailabilityTester

private SensorDeviceAvailabilityTester()
Constructor

Method Detail

getInstance

public static final SensorDeviceAvailabilityTester getInstance()
Access to the singleton instance of the preference manager

Returns:
the instance

getVecSensorDevices

private final Vector<SensorDeviceIdentifier> getVecSensorDevices()
Getter for the vecSensorDevices

Returns:
the vecSensorDevices

setVecSensorDevices

private final void setVecSensorDevices(Vector<SensorDeviceIdentifier> vecSensorDevices)
Setter for the vecSensorDevices

Parameters:
vecSensorDevices - the vecSensorDevices to set

isInitialized

public final boolean isInitialized()
Getter for the initialized

Returns:
the initialized

setInitialized

private final void setInitialized(boolean initialized)
Setter for the initialized

Parameters:
initialized - the initialized to set

detectAvailableSensorDevices

private final void detectAvailableSensorDevices(Set<SensorDeviceIdentifier> configuredDevices,
                                                Context applicationContext)
Does detect available sensor devices

Parameters:
configuredDevices - the configured devices for the service
applicationContext - the application context

isDeviceAvailable

private final boolean isDeviceAvailable(SensorDeviceIdentifier identifier,
                                        Context applicationContext)
Test method for availability of a specific sensor device

Parameters:
identifier - the device identifier
applicationContext - the application context
Returns:
true if sensor is available, false otherwise

getAvailableSensorDevices

public final List<SensorDeviceIdentifier> getAvailableSensorDevices()
Getter for available Sensor devices

Returns:
a list with the identifiers of available sensor devices

configure

public final void configure(Set<SensorDeviceIdentifier> configuredDevices,
                            Context applicationContext)
Method to inject the sensor devices from service configuration

Parameters:
configuredDevices - the configured devices for the service
applicationContext - the application context