ewex.registry
Class RegistryKey

java.lang.Object
  extended byewex.registry.RegistryKey

public class RegistryKey
extends Object


Field Summary
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 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).
 
Constructor Summary
protected RegistryKey()
           
 
Method Summary
protected  boolean checkValid()
           
 boolean delete()
          Delete the entire key and all its subkeys (if possible).
protected  boolean deleteAKey()
           
protected  boolean deleteAValue(String name)
           
 boolean deleteValue(String name)
          Delete a value with the specified name.
 RegistryKey getCopy()
           
 String getFullPath()
           
protected  boolean getIndexedValue(int index, ewex.registry.RegistryData data)
          Set a 32-bit data value in either little-endian or big-endian format.
 String getName()
          This returns the name of the subkey without the parent path.
protected  boolean getNamedValue(String name, ewex.registry.RegistryData data)
           
 String getPath()
           
 int getRoot()
           
 String getSubKey(int index)
           
 RegistryKey getSubKey(String subkeyPath)
           
 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 a ewe.sys.Long (representing a 32-bit value) or null.
protected  boolean setABinaryValue(String name, byte[] value)
           
protected  boolean setAnIntValue(String name, int value)
           
protected  boolean setAStringValue(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.
 String toString()
          Return a String representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode
 

Field Detail

SORT_DONT_SORT

public static final int SORT_DONT_SORT
This is an option for getSubKeys(int options).

See Also:
Constant Field Values

SORT_CASE_SENSITIVE

public static final int SORT_CASE_SENSITIVE
This is an option for getSubKeys(int options).

See Also:
Constant Field Values

SORT_DESCENDING

public static final int SORT_DESCENDING
This is an option for getSubKeys(int options).

See Also:
Constant Field Values

GET_INDEXES

public static final 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.

See Also:
Constant Field Values

GET_INDEXES_AS_LONGS

public static final 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.

See Also:
Constant Field Values
Constructor Detail

RegistryKey

protected RegistryKey()
Method Detail

getCopy

public RegistryKey getCopy()

getSubKey

public RegistryKey getSubKey(String subkeyPath)

getRoot

public int getRoot()

getPath

public String getPath()

getFullPath

public String getFullPath()

getName

public String getName()
This returns the name of the subkey without the parent path.


toString

public String toString()
Description copied from class: Object
Return a String representation of this object.

Overrides:
toString in class Object
Returns:
a String representing this object.

getValue

public Object getValue(String valueName)
This returns either a String or a byte array, or a ewe.sys.Long (representing a 32-bit value) or null. If valueName is null or an empty String then the default value will be returned.


getValue

public Object getValue(int index,
                       StringBuffer valueName)
Get a value at the specified index. The name of the value is placed in the valueName StringBuffer. The return value is either a String or a byte array or a Long (representing a 32-bit value) or null.


deleteValue

public boolean deleteValue(String name)
Delete a value with the specified name.


delete

public boolean delete()
Delete the entire key and all its subkeys (if possible).


setValue

public boolean setValue(String name,
                        String value)
Set a String value.


setValue

public boolean setValue(String name,
                        byte[] value)
Set a binary data value.


setValue

public boolean setValue(String name,
                        int value)
Set a 32-bit data value in the default little-endian format.


getIndexedValue

protected boolean getIndexedValue(int index,
                                  ewex.registry.RegistryData data)
Set a 32-bit data value in either little-endian or big-endian format.


getNamedValue

protected boolean getNamedValue(String name,
                                ewex.registry.RegistryData data)

setAStringValue

protected boolean setAStringValue(String name,
                                  String value)

setABinaryValue

protected boolean setABinaryValue(String name,
                                  byte[] value)

setAnIntValue

protected boolean setAnIntValue(String name,
                                int value)

deleteAValue

protected boolean deleteAValue(String name)

deleteAKey

protected boolean deleteAKey()

checkValid

protected boolean checkValid()

getSubKey

public String getSubKey(int index)

getSubKeys

public Object getSubKeys(int options)
Return an array of Strings or an array of integers or array of longs representing the subkeys of this key.

Parameters:
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.

Returns:
an array of Strings or an array of integers or array of longs representing the subkeys of this key.

getSubKeyCount

public int getSubKeyCount()