public interface SettingsNode
| Modifier and Type | Method and Description |
|---|---|
SettingsNode |
addChild(String name)
Call this to add a child node to this node.
|
SettingsNode |
addChildIfNotPresent(String name)
This adds a child node with the specified name or returns the existing child node if one already exists with said name.
|
SettingsNode |
getChildNode(String name)
Returns the child node with the specified name.
|
List<SettingsNode> |
getChildNodes() |
List<SettingsNode> |
getChildNodes(String name) |
String |
getName() |
SettingsNode |
getNodeAtPath(String... pathPortions)
Returns a node at the specified path starting at 'this' node.
|
String |
getValue() |
String |
getValueOfChild(String name,
String defaultValue)
Gets the value of the child node.
|
boolean |
getValueOfChildAsBoolean(String name,
boolean defaultValue) |
int |
getValueOfChildAsInt(String name,
int defaultValue)
Gets the value of the child node as an integer.
|
long |
getValueOfChildAsLong(String name,
long defaultValue) |
void |
removeAllChildren()
Deletes all the children of this node.
|
void |
removeFromParent()
Removes this node from its parent.
|
void |
setName(String name)
Sets the name of this node.
|
void |
setValue(String value)
Sets the value of this node.
|
void |
setValueOfChild(String name,
String value)
Sets the value of the child node, adding it if it is not already present.
|
void |
setValueOfChildAsBoolean(String name,
boolean value) |
void |
setValueOfChildAsInt(String name,
int value)
Sets the value of the child node as an integer, adding it if it is not already present.
|
void |
setValueOfChildAsLong(String name,
long value) |
void setName(String name)
name - the new name. Cannot be null!String getName()
void setValue(String value)
value - the new value. Can be null.String getValue()
void setValueOfChild(String name, String value)
name - the name of the child node.value - the new value.String getValueOfChild(String name, String defaultValue)
name - the name of the child node.defaultValue - the value to return if the child node is not presentvoid setValueOfChildAsInt(String name, int value)
name - the name of the child node.value - the new value.int getValueOfChildAsInt(String name, int defaultValue)
name - the name of the child node.defaultValue - the value to return if the child node is not present or cannot be interpretted as an integer.void setValueOfChildAsBoolean(String name, boolean value)
boolean getValueOfChildAsBoolean(String name, boolean defaultValue)
void setValueOfChildAsLong(String name, long value)
long getValueOfChildAsLong(String name, long defaultValue)
List<SettingsNode> getChildNodes()
List<SettingsNode> getChildNodes(String name)
name - the names of the sought child nodes.SettingsNode getChildNode(String name)
name - the name of the sought nodeSettingsNode addChild(String name)
name - the name of the nodeSettingsNode addChildIfNotPresent(String name)
name - the name.SettingsNode getNodeAtPath(String... pathPortions)
pathPortions - an array of 'names' of the nodes. The first item corresponds to a direct child of this node. The second item would be the grand child of this node. etc. etc.void removeFromParent()
void removeAllChildren()
Copyright © 2013. All rights reserved