| java.lang.Object com.sun.midp.util.Properties
All known Subclasses: com.sun.midp.installer.JadProperties,
Properties | public class Properties (Code) | | The Properties class represents a persistent set of
properties. Each key and its corresponding value in
the property list is a string.
|
Constructor Summary | |
public | Properties() Constructor - creates an empty property list. | public | Properties(String[] propertyStrings) Constructor - creates an populated property list. |
Method Summary | |
public synchronized void | addProperty(String key, String value) Store multiple key:value pair. | public String | getKeyAt(int index) Gets a property key by index. | public String | getProperty(String key) Searches for the property with the specified key in this property list.
The method returns null if the property is not found.
Parameters: key - the property key. | public String | getPropertyIgnoreCase(String key) This method is very similar to getproperty() except with a difference
that the keys are searched in case-insensitive manner. | public String | getValueAt(int index) Gets a property value by index. | public synchronized String | removeProperty(String key) Removes a property (key:value pair) from the property
list based on the key string.
Parameters: key - the key to be removed from the property list. | public synchronized String | setProperty(String key, String value) Store a single key:value pair. | public synchronized String | setPropertyAt(int index, String value) Replace the value of the property at the given index.
Parameters: index - 0 based index of a property Parameters: value - the new value for the property at index. | public synchronized String | setPropertyIgnoreCase(String key, String value) Store a single key:value pair. | public int | size() Gets the number of properties. |
Properties | public Properties()(Code) | | Constructor - creates an empty property list.
|
Properties | public Properties(String[] propertyStrings)(Code) | | Constructor - creates an populated property list.
Parameters: propertyStrings - an array of Strings 2 per property, will befilled in with a pair pattern of key and value, this exact arraywill be used for property lookup (the array will not be changed).No other allocation will be done until the array is changed and atthat time the initial property array will be released. |
addProperty | public synchronized void addProperty(String key, String value)(Code) | | Store multiple key:value pair. Provided for parallelism with the
getProperty method. Enforces use of strings for
property keys and values.
Parameters: key - the key to be placed into this property list. Parameters: value - the value corresponding to key. See Also: Properties.getProperty |
getKeyAt | public String getKeyAt(int index)(Code) | | Gets a property key by index. Used by the JadWriter as part of the
JAD Tool.
Parameters: index - 0 based index of a property the key of the property with the specified index. exception: ArrayIndexOutOfBoundsException - if an invalid index was given. |
getPropertyIgnoreCase | public String getPropertyIgnoreCase(String key)(Code) | | This method is very similar to getproperty() except with a difference
that the keys are searched in case-insensitive manner. This is needed in
certain situations like HTTP header names.
Parameters: key - the property key. the value in this property list with the specified key value. exception: NullPointerException - is thrown if key is null . See Also: Properties.setProperty See Also: Properties.removeProperty |
getValueAt | public String getValueAt(int index)(Code) | | Gets a property value by index. Used by the JadWriter as part of the
JAD Tool.
Parameters: index - 0 based index of a property the value of the property with the specified index. exception: ArrayIndexOutOfBoundsException - if an invalid index was given. |
removeProperty | public synchronized String removeProperty(String key)(Code) | | Removes a property (key:value pair) from the property
list based on the key string.
Parameters: key - the key to be removed from the property list. the element associated with the key. See Also: Properties.setProperty See Also: Properties.getProperty |
setProperty | public synchronized String setProperty(String key, String value)(Code) | | Store a single key:value pair. Provided for parallelism with the
getProperty method. Enforces use of strings for
property keys and values. If a key already exists in storage,
the value corresponding to that key will be replaced and returned.
Parameters: key - the key to be placed into this property list. Parameters: value - the value corresponding to key. if the new property value replaces an existing one, the old value is returned. otherwise, null is returned. See Also: Properties.getProperty See Also: Properties.removeProperty |
setPropertyAt | public synchronized String setPropertyAt(int index, String value)(Code) | | Replace the value of the property at the given index.
Parameters: index - 0 based index of a property Parameters: value - the new value for the property at index. previous value exception: IndexOutOfBoundsException - if the index is out of bounds |
setPropertyIgnoreCase | public synchronized String setPropertyIgnoreCase(String key, String value)(Code) | | Store a single key:value pair.
This method is very similar to setproperty() except with a difference
that the keys are stored in case-insensitive manner. This is needed in
certain situations like HTTP header names.
Parameters: key - the key to be placed into this property list. Parameters: value - the value corresponding to key. if the new property value replaces an existing one, the old value is returned. otherwise, null is returned. See Also: Properties.getProperty See Also: Properties.removeProperty |
size | public int size()(Code) | | Gets the number of properties.
number of properties |
|
|