P
- the type of path componentsV
- the element type stored in the treepublic class CmsPathTree<P,V> extends java.lang.Object
A tree consists of a (possibly empty) value and a map from child names to subtrees.
Constructor and Description |
---|
CmsPathTree() |
Modifier and Type | Method and Description |
---|---|
void |
collectEntries(java.util.Collection<V> target)
Collect all descendant values in the given collection.
|
CmsPathTree<P,V> |
findNode(java.util.List<P> path)
Finds the node for the given path, and returns it or null if node was found.
|
CmsPathTree<P,V> |
getChild(P pathPart)
Gets the child for the given path component.
|
java.util.List<V> |
getChildValues()
Returns the values for the direct children of this node.
|
java.util.List<V> |
getChildValues(java.util.List<P> path)
Gets the child values for the given path.
|
java.util.List<V> |
getDescendantValues(java.util.List<P> path)
Gets the descendant values.
|
V |
getValue()
Gets the value for this node (may be null).
|
V |
getValue(java.util.List<P> path)
Gets the value for the sub-path given, starting from this node.
|
void |
setValue(java.util.List<P> path,
V value)
Sets the value for the sub-path given, starting from this node.
|
void |
setValue(V value)
Sets the value for this node.
|
public CmsPathTree()
public void collectEntries(java.util.Collection<V> target)
target
- the collection in which to store the descendant valuespublic CmsPathTree<P,V> findNode(java.util.List<P> path)
path
- the pathpublic CmsPathTree<P,V> getChild(P pathPart)
pathPart
- the path componentpublic java.util.List<V> getChildValues()
public java.util.List<V> getChildValues(java.util.List<P> path)
path
- the pathpublic java.util.List<V> getDescendantValues(java.util.List<P> path)
path
- the pathpublic V getValue(java.util.List<P> path)
path
- the pathpublic void setValue(java.util.List<P> path, V value)
path
- the pathvalue
- the value to set