de.unikassel.android.sdcframework.preferences
Class SensorDevicePreferencesImpl

Package class diagram package SensorDevicePreferencesImpl
java.lang.Object
  extended by de.unikassel.android.sdcframework.preferences.SensorDevicePreferencesImpl
All Implemented Interfaces:
SensorDevicePreferences, SinglePreference<SensorDeviceConfiguration>

public final class SensorDevicePreferencesImpl
extends Object
implements SensorDevicePreferences


Field Summary
private  SensorDeviceIdentifier deviceID
          The device identifier
private  SinglePreference<Boolean> enabledPreference
          The enabled preference
private  SinglePreference<Integer> frequencyPreference
          The frequency preference
static String KEY_APPENDIX
          The preference screen key for the device
private  SinglePreference<SensorDevicePriorities> priorityPreference
          The priority preference
 
Constructor Summary
SensorDevicePreferencesImpl(SensorDeviceIdentifier deviceID)
          Constructor
 
Method Summary
 SensorDeviceConfiguration getConfiguration(SharedPreferences sharedPreferences)
          Getter for the current value in the shared preferences
 SensorDeviceConfiguration getDefault()
          Getter for the default value
 SensorDeviceIdentifier getDeviceIdentifier()
          Getter for the device identifier
 SinglePreference<Boolean> getEnabledPreference()
          Getter for the enabled flag preference
 SinglePreference<Integer> getFrequencyPreference()
          Getter for the frequency preference
 String getKey()
          Getter for the preference key
 SinglePreference<SensorDevicePriorities> getPriorityPreference()
          Getter for the priority preference
 void setDefault(SensorDeviceConfiguration defaultValue)
          Setter for the default value
private  void setDeviceIdentifier(SensorDeviceIdentifier identifier)
          Setter for the device identifier
 boolean testForKey(String key)
          Method to test for a preferences key support
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY_APPENDIX

public static final String KEY_APPENDIX
The preference screen key for the device

See Also:
Constant Field Values

deviceID

private SensorDeviceIdentifier deviceID
The device identifier


frequencyPreference

private final SinglePreference<Integer> frequencyPreference
The frequency preference


priorityPreference

private final SinglePreference<SensorDevicePriorities> priorityPreference
The priority preference


enabledPreference

private final SinglePreference<Boolean> enabledPreference
The enabled preference

Constructor Detail

SensorDevicePreferencesImpl

public SensorDevicePreferencesImpl(SensorDeviceIdentifier deviceID)
Constructor

Parameters:
deviceID - the device identifier
Method Detail

getFrequencyPreference

public final SinglePreference<Integer> getFrequencyPreference()
Description copied from interface: SensorDevicePreferences
Getter for the frequency preference

Specified by:
getFrequencyPreference in interface SensorDevicePreferences
Returns:
the frequency preference

getPriorityPreference

public final SinglePreference<SensorDevicePriorities> getPriorityPreference()
Description copied from interface: SensorDevicePreferences
Getter for the priority preference

Specified by:
getPriorityPreference in interface SensorDevicePreferences
Returns:
the priority preference

getEnabledPreference

public final SinglePreference<Boolean> getEnabledPreference()
Description copied from interface: SensorDevicePreferences
Getter for the enabled flag preference

Specified by:
getEnabledPreference in interface SensorDevicePreferences
Returns:
the enabled flag preference

getConfiguration

public final SensorDeviceConfiguration getConfiguration(SharedPreferences sharedPreferences)
Description copied from interface: SinglePreference
Getter for the current value in the shared preferences

Specified by:
getConfiguration in interface SinglePreference<SensorDeviceConfiguration>
Parameters:
sharedPreferences - the shared application preferences
Returns:
the current value

getDeviceIdentifier

public final SensorDeviceIdentifier getDeviceIdentifier()
Description copied from interface: SensorDevicePreferences
Getter for the device identifier

Specified by:
getDeviceIdentifier in interface SensorDevicePreferences
Returns:
the device identifier

setDeviceIdentifier

private final void setDeviceIdentifier(SensorDeviceIdentifier identifier)
Setter for the device identifier

Parameters:
identifier - the device identifier

getKey

public final String getKey()
Description copied from interface: SinglePreference
Getter for the preference key

Specified by:
getKey in interface SinglePreference<SensorDeviceConfiguration>
Returns:
the preference key

getDefault

public final SensorDeviceConfiguration getDefault()
Description copied from interface: SinglePreference
Getter for the default value

Specified by:
getDefault in interface SinglePreference<SensorDeviceConfiguration>
Returns:
the default value

setDefault

public final void setDefault(SensorDeviceConfiguration defaultValue)
Description copied from interface: SinglePreference
Setter for the default value

Specified by:
setDefault in interface SinglePreference<SensorDeviceConfiguration>
Parameters:
defaultValue - the default value to set

testForKey

public boolean testForKey(String key)
Description copied from interface: SinglePreference
Method to test for a preferences key support

Specified by:
testForKey in interface SinglePreference<SensorDeviceConfiguration>
Parameters:
key - the key to test for
Returns:
true if this key is supported, false otherwise