public class KeyTree extends Object implements Iterable<KeyTree.Node>
Modifier and Type | Class and Description |
---|---|
class |
KeyTree.Node |
Modifier and Type | Field and Description |
---|---|
protected ConfigurationOptions |
options |
protected KeyTree.Node |
root |
Constructor and Description |
---|
KeyTree(ConfigurationOptions options) |
Modifier and Type | Method and Description |
---|---|
KeyTree.Node |
add(String path)
Get a child from its path.
|
List<KeyTree.Node> |
children() |
protected KeyTree.Node |
createNode(KeyTree.Node parent,
int indent,
String key) |
Set<Map.Entry<String,KeyTree.Node>> |
entries() |
KeyTree.Node |
findParent(int indent)
Get the last node that can be a parent of a child with the indent provided.
|
protected KeyTree.Node |
findParent(KeyTree.Node parent,
int indent) |
KeyTree.Node |
get(String path)
Get a child from its path.
|
KeyTree.Node |
getOrAdd(String path)
Get a child from its path.
|
KeyTree.Node |
getPriority(String path)
Get a child from its path.
|
KeyTree.Node |
getRoot()
Get the root node.
|
Iterator<KeyTree.Node> |
iterator() |
Set<String> |
keys() |
ConfigurationOptions |
options() |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
protected final KeyTree.Node root
protected final ConfigurationOptions options
public KeyTree(ConfigurationOptions options)
public KeyTree.Node findParent(int indent)
indent
- the indent to look forpublic KeyTree.Node getRoot()
public KeyTree.Node get(String path)
path
- the path of names to look for separated by options()
ConfigurationOptions.pathSeparator()
public KeyTree.Node getPriority(String path)
add(String)
.path
- the path of names to look for separated by options()
ConfigurationOptions.pathSeparator()
public KeyTree.Node getOrAdd(String path)
path
- the path of names to look for separated by options()
ConfigurationOptions.pathSeparator()
public KeyTree.Node add(String path)
path
- the path of names to look for separated by options()
ConfigurationOptions.pathSeparator()
public List<KeyTree.Node> children()
public Set<Map.Entry<String,KeyTree.Node>> entries()
public ConfigurationOptions options()
public Iterator<KeyTree.Node> iterator()
iterator
in interface Iterable<KeyTree.Node>
protected KeyTree.Node findParent(KeyTree.Node parent, int indent)
protected KeyTree.Node createNode(KeyTree.Node parent, int indent, String key)
Copyright © 2023. All rights reserved.