T
- The leaf typepublic interface StringTree<T>
Modifier and Type | Method and Description |
---|---|
Map<String,StringTree<T>> |
getChildMap()
Get a map of all direct subtrees, assuming that all subtrees are uniquely named.
|
Map<String,List<StringTree<T>>> |
getChildMultimap()
Get a map of all direct children of this node.
|
Map<String,T> |
getLeafMap()
Get a map of the names and values of all subtrees, assuming that all subtrees are leafs and are uniquely named.
|
Map<String,List<T>> |
getLeafMultimap()
Get a multimap of the names and values of all direct subtrees, assuming that all subtrees are leafs.
|
StringTree<T> |
getSubTree(String name)
Get the only subtree with the given name.
|
List<StringTree<T>> |
getSubTrees(String name)
Get the named subtrees.
|
T |
getValue()
Get the value of a leaf.
|
T |
getValue(String name)
Get the value of a named sub-leaf.
|
boolean |
isLeaf()
Returns true if this object is a leaf, and thus if getValue is legal.
|
boolean isLeaf()
T getValue(String name)
name
- Name of the sub-leaf to get the value of. These are strings, and as a shorthand may specify subtrees
of subtrees by separating each level with '.', i.e. getSubtrees("subtree.subsubtree").IllegalState
- if this StringTree does not have exactly one leaf sub-node with the given name.ArgumentNotValid
- if argument is null or empty.T getValue()
IllegalState
- if this StringTree is a node.StringTree<T> getSubTree(String name)
name
- The name of the subtree. These are strings, and as a shorthand may specify subtrees of subtrees by
separating each level with '.', i.e. getSubtrees("subtree.subsubtree").IllegalState
- if this object is a leaf or if there is not exactly one subtree with the given name.ArgumentNotValid
- if argument is null or empty.List<StringTree<T>> getSubTrees(String name)
name
- The name of the subtrees. These are strings, and as a shorthand may specify subtrees of subtrees by
separating each level with '.', i.e. getSubtrees("subtree.subsubtree").IllegalState
- if this object is a leaf.ArgumentNotValid
- if argument is null or empty.Map<String,List<StringTree<T>>> getChildMultimap()
IllegalState
- if this object is a leaf.Map<String,StringTree<T>> getChildMap()
IllegalState
- if this object is a leaf or if there is more than one subtree with the same name.Map<String,List<T>> getLeafMultimap()
IllegalState
- if this object is a leaf or if any of its children are not leaves.Map<String,T> getLeafMap()
IllegalState
- if this object is a leaf or if the subtrees are not uniquely named, or if any of its
children are not leaves.Copyright © 2005–2015 The Royal Danish Library, the Danish State and University Library, the National Library of France and the Austrian National Library.. All rights reserved.