|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectariba.util.core.PropertyTable
public class PropertyTable
PropertyTable is an extension of a Map
which provides additional convenience methods and some minor semantic
changes. For example, calling the setPropertyForKey method
with a null value removes the value for the given key from the
PropertyTable. There are also convenience methods for
returning a property as a particular type; if the value stored in the
PropertyTable is of a different type, a reasonable conversion
is done. Finally, it is possible to store a null in a property table
using a special object to represent that.
| Field Summary | |
|---|---|
static String |
NullValueMarker
A special object that represent a null value stored in a PropertyTable. |
| Constructor Summary | |
|---|---|
PropertyTable()
Creates a new empty PropertyTable. |
|
PropertyTable(Map properties)
Creates a new PropertyTable from the given
Map of properties. |
|
| Method Summary | |
|---|---|
boolean |
booleanPropertyForKey(String key)
Return the property for the given key as a boolean. |
boolean |
containsKey(String key)
Returns whether the table contains a value for the given key. |
Object |
debugState()
Returns an object that will be toStringed when the debug information needs to be printed. |
double |
doublePropertyForKey(String key)
Return the property for the given key as a double. |
Iterator |
getAllProperties()
Return an Iterator of all the properties stored in
this table. |
int |
getCount()
Return the number of properties in the table. |
Map |
getProperties()
Returns the properties stored in this table as a Map. |
Object |
getPropertyForKey(String key)
Return the property for the given key. |
int |
integerPropertyForKey(String key)
Return the property for the given key as an int. |
void |
setPropertyForKey(String key,
Object value)
Sets a property value for the given key. |
String |
stringPropertyForKey(String key)
Return the property for the given key as a string. |
String |
toString()
Returns a string reprsentation of this table of properties. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String NullValueMarker
PropertyTable.
| Constructor Detail |
|---|
public PropertyTable()
PropertyTable.
public PropertyTable(Map properties)
PropertyTable from the given
Map of properties.
properties - the properties to store in this table| Method Detail |
|---|
public Map getProperties()
Map.
Map of propertiespublic Iterator getAllProperties()
Iterator of all the properties stored in
this table.
Iterator of the properties in this tablepublic Object getPropertyForKey(String key)
NullValueMarker.
key - the key for the property to retrieve
public void setPropertyForKey(String key,
Object value)
key - the key under which to store the valuevalue - the new value, or null to remove the current valuepublic String stringPropertyForKey(String key)
toString
method is called on the value. Returns null if the given key is null.
key - the key for the property to retrieve
public boolean booleanPropertyForKey(String key)
boolean. If
the current value for the property is not a boolean, the value is
converted using the booleanValue method from the
Util class. Returns null if the given key is null.
key - the key for the property to retrieve
public int integerPropertyForKey(String key)
int. If the
current value for the property is not an integer, the value is
converted using the intValue method from the
Util class. Returns null if the given key is null.
key - the key for the property to retrieve
public double doublePropertyForKey(String key)
double. If
the current value for the property is not a double, the value is
converted using the doubleValue method from the
Util class. Returns null if the given key is null.
key - the key for the property to retrieve
public int getCount()
public boolean containsKey(String key)
NullValueMarker, this method
will return true.
key - the key for the property to test
public String toString()
toString in class Objectpublic Object debugState()
debugState in interface DebugStateThreadDebugState.set(ariba.util.core.ThreadDebugKey, java.lang.Object)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||