de.unikassel.android.sdcframework.preferences
Class PriorityLevelPreference

Package class diagram package PriorityLevelPreference
java.lang.Object
  extended by de.unikassel.android.sdcframework.preferences.SinglePreferenceImpl<SensorDevicePriorities>
      extended by de.unikassel.android.sdcframework.preferences.PriorityLevelPreference
All Implemented Interfaces:
SinglePreference<SensorDevicePriorities>

public final class PriorityLevelPreference
extends SinglePreferenceImpl<SensorDevicePriorities>

Implementation of the preference for the device priority.


Field Summary
static SensorDevicePriorities DEFAULT
          The deafult value
static String KEY
          The frequency key
 
Constructor Summary
PriorityLevelPreference()
          Constructor
PriorityLevelPreference(String keySuffix)
          Constructor
 
Method Summary
 SensorDevicePriorities getConfiguration(SharedPreferences sharedPreferences)
          Getter for the current value in the shared preferences
static SensorDevicePriorities toPriorityLevel(Integer ordinalLevel)
          Does convert an ordinal level value to it's corresponding sensor device priority level.
 
Methods inherited from class de.unikassel.android.sdcframework.preferences.SinglePreferenceImpl
getDefault, getKey, setDefault, testForKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY

public static final String KEY
The frequency key

See Also:
Constant Field Values

DEFAULT

public static final SensorDevicePriorities DEFAULT
The deafult value

Constructor Detail

PriorityLevelPreference

public PriorityLevelPreference()
Constructor


PriorityLevelPreference

public PriorityLevelPreference(String keySuffix)
Constructor

Parameters:
keySuffix - the key suffix
Method Detail

getConfiguration

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

Parameters:
sharedPreferences - the shared application preferences
Returns:
the current value

toPriorityLevel

public static SensorDevicePriorities toPriorityLevel(Integer ordinalLevel)
Does convert an ordinal level value to it's corresponding sensor device priority level. For invalid ordinal values null will be returned.

Parameters:
ordinalLevel - the ordinal level value
Returns:
the corresponding priority level or null if no level did match