|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.Dictionary<K,V>
java.util.Hashtable<java.lang.Object,java.lang.Object>
java.util.Properties
com.edustructures.sifworks.ADKProperties
public class ADKProperties
The abstract base class for agent and zone properties.
ADKProperties adds convenience methods to the java.util.Properties class for getting and setting property values by data type. In addition, it overrides the getProperty method to inherit the property value from its parent if not defined locally. In the ADK, the properties of a zone are always inherited from the default properties of the agent.
Note that property inheritance is only provided by the getProperty method; no other superclass methods support inheritance. Thus, calling enumerating property elements does not include the properties of the parent object. Similarly, saving an ADKProperties to disk with the store method only writes the properties that are defined locally. When the properties are subsequently read from disk, they will not include the inherited properties of the parent object, nor will the object's relationship with its parent be re-established.
| Constructor Summary | |
|---|---|
ADKProperties(ADKProperties inherit)
Creates a properties object that inherits values from a parent |
|
| Method Summary | |
|---|---|
ADKProperties |
getParent()
Gets the parent object from which properties are inherited |
java.lang.String |
getProperty(java.lang.String name)
Overridden to inherit properties from parent |
boolean |
getProperty(java.lang.String prop,
boolean def)
Gets a property value as a boolean. |
int |
getProperty(java.lang.String prop,
int defaultValue)
Gets a property value as an int. |
java.lang.String |
getProperty(java.lang.String prop,
java.lang.String defaultValue)
Gets a property value as a String. |
void |
setProperty(java.lang.String prop,
boolean value)
Sets a boolean property |
void |
setProperty(java.lang.String prop,
int value)
Sets an int property |
java.lang.Object |
setProperty(java.lang.String name,
java.lang.String value)
Sets the value of a string property |
| Methods inherited from class java.util.Properties |
|---|
list, list, load, loadFromXML, propertyNames, save, store, storeToXML, storeToXML |
| Methods inherited from class java.util.Hashtable |
|---|
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, remove, size, toString, values |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ADKProperties(ADKProperties inherit)
inherit - The parent ADKProperties object| Method Detail |
|---|
public ADKProperties getParent()
public java.lang.String getProperty(java.lang.String prop,
java.lang.String defaultValue)
String. The property is
inherited from this object's parent if not defined locally.
getProperty in class java.util.Propertiesprop - The name of the propertydefaultValue - The default value to return when the proprety is undefined
public int getProperty(java.lang.String prop,
int defaultValue)
int. The property is
inherited from this object's parent if not defined locally.
prop - The name of the propertydefaultValue - The default value to return when the proprety is
undefined or is not an integer
public boolean getProperty(java.lang.String prop,
boolean def)
boolean. The property is
inherited from this object's parent if not defined.
prop - The name of the propertydefaultValue - The default value to return when the proprety is
undefined or is not set to "true"
public void setProperty(java.lang.String prop,
int value)
int property
prop - The name of the propertyvalue - The property value
public void setProperty(java.lang.String prop,
boolean value)
boolean property
prop - The name of the propertyvalue - The property value
public java.lang.Object setProperty(java.lang.String name,
java.lang.String value)
setProperty in class java.util.Propertiesname - The name of the propertyvalue - The property valuepublic java.lang.String getProperty(java.lang.String name)
getProperty in class java.util.Propertiesname - The property name
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||