Interface Preferences
public interface Preferences
Enables data to be stored and accessed from the Java preference store. Supports primitives.
-
Method Summary
Modifier and TypeMethodDescriptionRetrieve all keys currently mapped forBooleanvalues.byteKeys()Retrieve all keys currently mapped forBytevalues.voiddeleteBoolean(String key) Removes the mapping from the specified key to theBoolean.voiddeleteByte(String key) Removes the mapping from the specified key to theByte.voiddeleteInteger(String key) Removes the mapping from the specified key to theInteger.voiddeleteLong(String key) Removes the mapping from the specified key to theLong.voiddeleteShort(String key) Removes the mapping from the specified key to theShort.voiddeleteString(String key) Removes the mapping from the specified key to theString.getBoolean(String key) Booleanassociated with the specified key.Byteassociated with the specified key.getInteger(String key) Integerassociated with the specified key.Longassociated with the specified key, ornull} if this map contains no mapping for the key.Shortassociated with the specified key.Stringassociated with the specified key.Retrieve all keys currently mapped forIntegervalues.longKeys()Retrieve all keys currently mapped forLongvalues.voidsetBoolean(String key, boolean value) Associates the specifiedbooleanwith the specified key in this map.voidAssociates the specifiedbytewith the specified key in this map.voidsetInteger(String key, int value) Associates the specifiedintwith the specified key in this map.voidAssociates the specifiedlongwith the specified key in this map.voidAssociates the specified short with the specified key in this map.voidAssociates the specifiedStringwith the specified key in this map.Retrieve all keys currently mapped forShortvalues.Retrieve all keys currently mapped forStringvalues.
-
Method Details
-
getString
Stringassociated with the specified key. Returnsnullif this map contains no mapping for the key.- Parameters:
key- The key whose associated value is to be returned.- Returns:
- The value associated with the specified key, or
nullif this map contains no mapping for the key.
-
setString
Associates the specifiedStringwith the specified key in this map. This is an optional operation. If the map previously contained a mapping for the key, the old value is replaced by the specified value.- Parameters:
key- The key with which the specified value is to be associated.value- The value to be associated with the specified key.
-
deleteString
-
stringKeys
-
getBoolean
Booleanassociated with the specified key. Returnsnullif this map contains no mapping for the key.- Parameters:
key- The key whose associated value is to be returned.- Returns:
- The value associated with the specified key, or
nullif this map contains no mapping for the key.
-
setBoolean
Associates the specifiedbooleanwith the specified key in this map. This is an optional operation. If the map previously contained a mapping for the key, the old value is replaced by the specified value.- Parameters:
key- The key with which the specified value is to be associated.value- The value to be associated with the specified key. If this value isnullthen any value that is currently mapped to the specified key is removed.
-
deleteBoolean
-
booleanKeys
-
getByte
-
setByte
Associates the specifiedbytewith the specified key in this map. This is an optional operation. If the map previously contained a mapping for the key, the old value is replaced by the specified value.- Parameters:
key- The key with which the specified value is to be associated.value- The value to be associated with the specified key. If this value isnullthen any value that is currently mapped to the specified key is removed.
-
deleteByte
-
byteKeys
-
getShort
Shortassociated with the specified key. Returnsnullif this map contains no mapping for the key.- Parameters:
key- The key whose associated value is to be returned.- Returns:
- The value associated with the specified key, or
nullif this map contains no mapping for the key.
-
setShort
Associates the specified short with the specified key in this map. This is an optional operation. If the map previously contained a mapping for the key, the old value is replaced by the specified value.- Parameters:
key- The key with which the specified value is to be associated.value- The value to be associated with the specified key. If this value isnullthen any value that is currently mapped to the specified key is removed.
-
deleteShort
-
shortKeys
-
getInteger
Integerassociated with the specified key. Returnsnullif this map contains no mapping for the key.- Parameters:
key- The key whose associated value is to be returned.- Returns:
- The value associated with the specified key, or
nullif this map contains no mapping for the key.
-
setInteger
Associates the specifiedintwith the specified key in this map. This is an optional operation. If the map previously contained a mapping for the key, the old value is replaced by the specified value.- Parameters:
key- The key with which the specified value is to be associated.value- The value to be associated with the specified key. If this value isnullthen any value that is currently mapped to the specified key is removed.
-
deleteInteger
-
integerKeys
-
getLong
-
setLong
Associates the specifiedlongwith the specified key in this map. This is an optional operation. If the map previously contained a mapping for the key, the old value is replaced by the specified value.- Parameters:
key- The key with which the specified value is to be associated.value- The value to be associated with the specified key. If this value isnullthen any value currently mapped to the specified key is removed.
-
deleteLong
-
longKeys
-