Methods Summary |
---|
public synchronized void | addProperty(java.lang.String key, java.lang.String value)Store multiple key:value pair. Provided for parallelism with the
getProperty method. Enforces use of strings for
property keys and values.
keys.addElement(key);
vals.addElement(value);
return;
|
public java.lang.String | getKeyAt(int index)Gets a property key by index. Used by the JadWriter as part of the
JAD Tool.
return (String)keys.elementAt(index);
|
public java.lang.String | getProperty(java.lang.String key)Searches for the property with the specified key in this property list.
The method returns null if the property is not found.
if (key == null) {
throw new NullPointerException();
}
int idx = keys.indexOf(key);
String rv = null;
if (idx > -1) {
rv = (String)vals.elementAt(idx);
}
return rv;
|
public java.lang.String | getValueAt(int index)Gets a property value by index. Used by the JadWriter as part of the
JAD Tool.
return (String)vals.elementAt(index);
|
public synchronized java.lang.String | removeProperty(java.lang.String key)Removes a property (key:value pair) from the property
list based on the key string.
int idx = keys.indexOf(key);
String rv = null;
if (idx > -1) {
rv = (String)vals.elementAt(idx);
keys.removeElementAt(idx);
vals.removeElementAt(idx);
}
return rv;
|
public synchronized java.lang.String | setProperty(java.lang.String key, java.lang.String value)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 corresponing to that key will be replaced and returned.
int idx = keys.indexOf(key);
String rv = null;
if (idx == -1) { // If I don't have this, add it and return null
keys.addElement(key);
vals.addElement(value);
} else { // Else replace it and return the old one.
rv = (String)vals.elementAt(idx);
vals.setElementAt(value, idx);
}
return rv;
|
public synchronized java.lang.String | setPropertyAt(int index, java.lang.String value)Replace the value of the property at the given index.
String rv = (String)vals.elementAt(index);
vals.setElementAt(value, index);
return rv;
|
public int | size()Gets the number of properties.
return keys.size();
|