ContactCenters
V. 0.9.9.

umontreal.iro.lecuyer.xmlconfig
Class PropertyParam

java.lang.Object
  extended by umontreal.iro.lecuyer.xmlconfig.AbstractParam
      extended by umontreal.iro.lecuyer.xmlconfig.PropertyParam
All Implemented Interfaces:
Cloneable, Param, StorableParam

public class PropertyParam
extends AbstractParam
implements StorableParam, Cloneable

Represents a property, i.e., a name-value pair.


Constructor Summary
PropertyParam()
          Nullary constructor for the parameter reader.
PropertyParam(String name, String value)
          Constructs a new property with name name, and value value.
 
Method Summary
 void check()
          Verifies that every needed parameter was specified.
 PropertyParam clone()
           
 boolean equals(Object o)
           
 String getName()
          Returns the name of this property.
 String getValue()
          Returns the value of this property.
 int hashCode()
           
 void setName(String name)
          Sets the name of the property to name.
 void setValue(String value)
          Sets the value of this property to value.
 Element toElement(ClassFinder finder, Node parent, String elementName, int spc)
          Converts this parameter object to a DOM element using the class finder finder for formatting class names, with parent node parent, element name elementName, and spc spaces for each indentation level.
 String toString()
           
 
Methods inherited from class umontreal.iro.lecuyer.xmlconfig.AbstractParam
createDocument, getId, getXref, setId, setXref, write, write, write, write, write, write, write, write
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PropertyParam

public PropertyParam()
Nullary constructor for the parameter reader.


PropertyParam

public PropertyParam(String name,
                     String value)
Constructs a new property with name name, and value value.

Parameters:
name - the name.
value - the value.
Throws:
NullPointerException - if name is null.
Method Detail

getName

public String getName()
Returns the name of this property.

Returns:
the name of the property.

setName

public void setName(String name)
Sets the name of the property to name.

Parameters:
name - the new name of the property.
Throws:
NullPointerException - if name is null.

getValue

public String getValue()
Returns the value of this property.

Returns:
the value of this property.

setValue

public void setValue(String value)
Sets the value of this property to value.

Parameters:
value - the value of this property.
Throws:
NullPointerException - if value is null.

check

public void check()
Description copied from class: AbstractParam
Verifies that every needed parameter was specified. Throws a ParamReadException in case of missing parameters.

Overrides:
check in class AbstractParam

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class AbstractParam

toElement

public Element toElement(ClassFinder finder,
                         Node parent,
                         String elementName,
                         int spc)
Description copied from interface: StorableParam
Converts this parameter object to a DOM element using the class finder finder for formatting class names, with parent node parent, element name elementName, and spc spaces for each indentation level. The method must create an Element instance with name elementName and add it to the node parent of the DOM tree. It is recommended to use DOMUtils helper methods for this. After the element is created, attributes can be set and nested contents can be added. The configured DOM element is then returned.

Specified by:
toElement in interface StorableParam
Parameters:
finder - the class finder used to format class names.
parent - the parent of the new element.
elementName - the name of the constructed element.
spc - the number of spaces for each indentation level.
Returns:
the newly-constructed element.

clone

public PropertyParam clone()
Overrides:
clone in class Object

ContactCenters
V. 0.9.9.

To submit a bug or ask questions, send an e-mail to Richard Simard.