public class ConfigurationNode extends java.lang.Object implements IHierarchyParent
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
_rcsid |
protected java.util.Map<java.lang.String,java.lang.String> |
attributes |
protected java.util.List<ConfigurationNode> |
children |
protected boolean |
readOnly |
protected java.lang.String |
type |
protected java.lang.String |
value |
| Constructor and Description |
|---|
ConfigurationNode(ConfigurationNode source)
Duplication constructor.
|
ConfigurationNode(java.lang.String type)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(int index,
ConfigurationNode child)
Add child at specified position.
|
void |
clearChildren()
Clear children.
|
protected static java.util.Map<java.lang.String,java.lang.String> |
cloneAttributes(java.util.Map<java.lang.String,java.lang.String> attributes) |
protected ConfigurationNode |
createDuplicate(boolean readOnly)
Create a duplicate of the current node.
|
protected ConfigurationNode |
createNewNode()
Make a new blank node identical in type and class to the current node.
|
protected ConfigurationNode |
createNewNode(ConfigurationNode source)
Make a new node that is a copy of the specified node.
|
boolean |
equals(java.lang.Object o)
Check if equals
|
ConfigurationNode |
findChild(int index)
Get child n.
|
int |
getAttributeCount()
Get the attribute count.
|
java.util.Iterator<java.lang.String> |
getAttributes()
Iterate over attributes.
|
java.lang.String |
getAttributeValue(java.lang.String attribute)
Get an attribute value.
|
int |
getChildCount()
Get child count.
|
java.lang.String |
getType()
Get type.
|
java.lang.String |
getValue()
Get value.
|
int |
hashCode()
Calculate a hashcode
|
void |
makeReadOnly()
Make this node (and its children) read-only
|
void |
removeChild(int index)
Remove child n.
|
void |
setAttribute(java.lang.String attribute,
java.lang.String value)
Set an attribute.
|
void |
setValue(java.lang.String value)
Set value.
|
java.lang.String |
toString()
Construct a human-readable string
|
public static final java.lang.String _rcsid
protected java.util.List<ConfigurationNode> children
protected java.util.Map<java.lang.String,java.lang.String> attributes
protected java.lang.String type
protected java.lang.String value
protected boolean readOnly
public ConfigurationNode(java.lang.String type)
public ConfigurationNode(ConfigurationNode source)
protected ConfigurationNode createNewNode()
protected ConfigurationNode createNewNode(ConfigurationNode source)
public void makeReadOnly()
protected ConfigurationNode createDuplicate(boolean readOnly)
public java.lang.String getType()
public void setValue(java.lang.String value)
value - is the value to set.public java.lang.String getValue()
public int getChildCount()
getChildCount in interface IHierarchyParentpublic ConfigurationNode findChild(int index)
findChild in interface IHierarchyParentindex - is the child number.public void removeChild(int index)
removeChild in interface IHierarchyParentindex - is the child to remove.public void addChild(int index,
ConfigurationNode child)
addChild in interface IHierarchyParentindex - is the position to add the child.child - is the child to add.public void clearChildren()
clearChildren in interface IHierarchyParentpublic void setAttribute(java.lang.String attribute,
java.lang.String value)
attribute - is the name of the attribute.value - is the value of the attribute (null to remove it).public int getAttributeCount()
public java.util.Iterator<java.lang.String> getAttributes()
public java.lang.String getAttributeValue(java.lang.String attribute)
attribute - is the name of the attribute.public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectprotected static java.util.Map<java.lang.String,java.lang.String> cloneAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)