public interface IPreferenceNode
Modifier and Type | Method and Description |
---|---|
void |
addPreferenceChildNode(IPreferenceNode node)
Add a new child to this PreferenceNode, that contains new preferences.
|
String |
getName()
Get the name of the PreferenceNode
|
IPreferenceNode |
getPreferenceChildNode(String key)
Get one child of this PreferncesNode, that belongs to the key.
|
HashMap |
getPreferenceChildNodes()
Get the HashMap, that contains all childs of this PreferenceNode.
|
void |
loadPreferences(Node node)
With this methode you can load information from an existing XML file.
|
boolean |
readBoolean(String key,
boolean defaultValue)
This methode will return an object out of the Hash Map, that includes all
preferences.
|
Color |
readColor(String key,
Color defaultValue)
This methode will return an object out of the Hash Map, that includes all
preferences.
|
double |
readDouble(String key,
double defaultValue)
This methode will return an object out of the Hash Map, that includes all
preferences.
|
int |
readInt(String key,
int defaultValue)
This methode will return an object out of the Hash Map, that includes all
preferences.
|
String |
readString(String key,
String defaultValue)
This methode will return an object out of the Hash Map, that includes all
preferences.
|
void |
removePreferenceChildNode(String key)
Remove one child of this PreferenceNode from the HashMap with all those
nodes.
|
Document |
save(Document document,
Node root)
With this methode you can save all information from the PreferenceNode in
a XML file.
|
void |
writeBoolean(String key,
boolean value)
This will write a Boolean object to the HashMap, that includes all
preferences.
|
void |
writeColor(String key,
Color value)
This will write a Color object to the HashMap, that includes all
preferences.
|
void |
writeDouble(String key,
double value)
This will write a Double object to the HashMap, that includes all
preferences.
|
void |
writeInt(String key,
int value)
This will write an Integer object to the HashMap,that includes all
prefernces.
|
void |
writeString(String key,
String value)
This will write a String object to the HashMap, that includes all
preferences.
|
String getName()
void addPreferenceChildNode(IPreferenceNode node)
node
- the node you want to add to this PreferenceNodevoid removePreferenceChildNode(String key)
key
- the name of the child, that should be removedHashMap getPreferenceChildNodes()
IPreferenceNode getPreferenceChildNode(String key)
key
- the name of the child, that should be returnedvoid writeInt(String key, int value)
key
- name of the preferencevalue
- value of the preferencevoid writeDouble(String key, double value)
key
- name of the preferencevalue
- value of the preferncevoid writeString(String key, String value)
key
- name of the preferencevalue
- value of the preferencevoid writeBoolean(String key, boolean value)
key
- name of the preferencevalue
- value of the preferencevoid writeColor(String key, Color value)
key
- name of the preferencevalue
- value of the preferenceint readInt(String key, int defaultValue)
key
- name of the preferencedefaultValue
- the value, that will be returned, if the key or the object is not correctdouble readDouble(String key, double defaultValue)
key
- name of the preferencedefaultValue
- the value, that will be returned, if the key or the object is not correctString readString(String key, String defaultValue)
key
- name of the preferencedefaultValue
- the value, that will be returned, if the key is not correctboolean readBoolean(String key, boolean defaultValue)
key
- name of the preferencedefaultValue
- the value, that will be returned, if the key or the object is not correctColor readColor(String key, Color defaultValue)
key
- name of the preferencedefaultValue
- the value, that will be returned, if the key or the object is not correctDocument save(Document document, Node root)
document
- the document, that gains tha new informationroot
- the parental node in the XML filevoid loadPreferences(Node node)
node
- all information of child nodes of this node will be saved