Class KeyTree
java.lang.Object
org.simpleyaml.configuration.comments.KeyTree
- All Implemented Interfaces:
Iterable<KeyTree.Node>
- Direct Known Subclasses:
YamlKeyTree
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ConfigurationOptionsprotected final KeyTree.Node -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet a child from its path.children()protected KeyTree.NodecreateNode(KeyTree.Node parent, int indent, String key) entries()findParent(int indent) Get the last node that can be a parent of a child with the indent provided.protected KeyTree.NodefindParent(KeyTree.Node parent, int indent) Get a child from its path.Get a child from its path.getPriority(String path) Get a child from its path.getRoot()Get the root node.iterator()keys()options()toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
root
-
options
-
-
Constructor Details
-
KeyTree
-
-
Method Details
-
findParent
Get the last node that can be a parent of a child with the indent provided.- Parameters:
indent- the indent to look for- Returns:
- the last most inner child that has less indent than the indent provided, or parent otherwise
-
getRoot
Get the root node.- Returns:
- the root node of this key tree
-
get
Get a child from its path. May contain repetitions with list elements when using names (values can be repeated on a list).- Parameters:
path- the path of names to look for separated byoptions()ConfigurationOptions.pathSeparator()- Returns:
- the child that has the provided path or null if not found
-
getPriority
Get a child from its path. Repetitions on list values are only allowed to keys inserted with priority usingadd(String).- Parameters:
path- the path of names to look for separated byoptions()ConfigurationOptions.pathSeparator()- Returns:
- the child that has the provided path or null if not found
-
getOrAdd
Get a child from its path. It is created if it does not exist.- Parameters:
path- the path of names to look for separated byoptions()ConfigurationOptions.pathSeparator()- Returns:
- the child that has the provided path
-
add
Get a child from its path. It is created with priority if it does not exist.- Parameters:
path- the path of names to look for separated byoptions()ConfigurationOptions.pathSeparator()- Returns:
- the child that has the provided path
-
keys
-
children
-
entries
-
options
-
toString
-
iterator
- Specified by:
iteratorin interfaceIterable<KeyTree.Node>
-
findParent
-
createNode
-