public interface IRegistryKey
Modifier and Type | Field and Description |
---|---|
static int |
GET_INDEXES
This is an option for getSubKeys(int options) - when used getSubKey() will return
an array of integers representing the indexes of all the sub-keys.
|
static int |
GET_INDEXES_AS_LONGS
/**
This is an option for getSubKeys(int options) - when used getSubKey() will return
an array of longs representing the indexes of all the sub-keys.
|
static int |
OPTION_READ_32_BIT_VALUES_ONLY |
static int |
OPTION_READ_64_BIT_VALUES_ONLY |
static int |
SORT_CASE_SENSITIVE
This is an option for getSubKeys(int options).
|
static int |
SORT_DESCENDING
This is an option for getSubKeys(int options).
|
static int |
SORT_DONT_SORT
This is an option for getSubKeys(int options).
|
Modifier and Type | Method and Description |
---|---|
IRegistryKey |
changeOptions(int switchOn,
int switchOff)
Get a new IRegistryKey with modified options.
|
boolean |
createKey(boolean createFullPath)
If the key does not exist, create it.
|
boolean |
deleteKey()
Delete the entire key and all its subkeys (if possible).
|
boolean |
deleteValue(String name)
Delete a value with the specified name.
|
String |
getFullKeyPath() |
String |
getKeyName()
Get the name to display for the key.
|
IRegistryKey |
getParentKey()
This should only return null for the root key.
|
IRegistryKey |
getRootKey()
Return the topmost key.
|
String |
getSubKey(int index) |
IRegistryKey |
getSubKey(String subkeyPath)
This should never return null, even if the subkey does not exist
or is illegal in some way.
|
int |
getSubKeyCount() |
Object |
getSubKeys(int options)
Return an array of Strings or an array of integers or array of longs representing the
subkeys of this key.
|
Object |
getValue(int index,
StringBuffer valueName)
Get a value at the specified index.
|
Object |
getValue(String valueName)
This returns either a String or a byte array, or an Integer (representing a 32-bit value)
or a StringBuffer for an expanding String or null.
|
int |
getValueCount() |
boolean |
keyExists()
Return true if the key already exists.
|
boolean |
setExpandingString(String name,
String value) |
boolean |
setValue(String name,
byte[] value)
Set a binary data value.
|
boolean |
setValue(String name,
int value)
Set a 32-bit data value in the default little-endian format.
|
boolean |
setValue(String name,
String value)
Set a String value.
|
static final int OPTION_READ_64_BIT_VALUES_ONLY
static final int OPTION_READ_32_BIT_VALUES_ONLY
static final int SORT_DONT_SORT
static final int SORT_CASE_SENSITIVE
static final int SORT_DESCENDING
static final int GET_INDEXES
static final int GET_INDEXES_AS_LONGS
IRegistryKey changeOptions(int switchOn, int switchOff)
switchOn
- options to switch on. Any of the OPTION_XXX valuesswitchOff
- options to switch off. Any of the OPTION_XXX valuesIRegistryKey getRootKey()
IRegistryKey getSubKey(String subkeyPath)
subkeyPath
- the subkey path relative to this key.boolean createKey(boolean createFullPath)
createFullPath
- if this is true then create all parent keys too.boolean keyExists()
String getFullKeyPath()
String getKeyName()
IRegistryKey getParentKey()
Object getValue(String valueName)
Object getValue(int index, StringBuffer valueName) throws IndexOutOfBoundsException
index
- the index of the value.valueName
- a StringBuffer to hold the value name.IndexOutOfBoundsException
- if the index is too high.boolean deleteValue(String name)
boolean deleteKey()
boolean setValue(String name, byte[] value)
boolean setValue(String name, int value)
String getSubKey(int index) throws IndexOutOfBoundsException
IndexOutOfBoundsException
int getSubKeyCount()
int getValueCount()
Object getSubKeys(int options)
options
- By default this will return an array of sorted Strings. If the GET_INDEXES
option is used, then an array of integer indexes (sorted by the sub-key name) will be returned.
If the GET_INDEXES_AS_LONGS option isused, then an array of long indexes (sorted by the sub-key name) will be returned.
& If SORT_DONT_SORT is used then the subkey list returned is not sorted.