Package org.opencms.util
Class CmsPathTree<P,V>
java.lang.Object
org.opencms.util.CmsPathTree<P,V>
- Type Parameters:
P
- the type of path componentsV
- the element type stored in the tree
Tree used to represent file system like data structures.
A tree consists of a (possibly empty) value and a map from child names to subtrees.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
collectEntries
(Collection<V> target) Collect all descendant values in the given collection.Finds the node for the given path, and returns it or null if node was found.Gets the child for the given path component.Returns the values for the direct children of this node.getChildValues
(List<P> path) Gets the child values for the given path.getDescendantValues
(List<P> path) Gets the descendant values.getValue()
Gets the value for this node (may be null).Gets the value for the sub-path given, starting from this node.void
Sets the value for the sub-path given, starting from this node.void
Sets the value for this node.
-
Constructor Details
-
CmsPathTree
public CmsPathTree()
-
-
Method Details
-
collectEntries
Collect all descendant values in the given collection.- Parameters:
target
- the collection in which to store the descendant values
-
findNode
Finds the node for the given path, and returns it or null if node was found.- Parameters:
path
- the path- Returns:
- the node for the path
-
getChild
Gets the child for the given path component.- Parameters:
pathPart
- the path component- Returns:
- the child for the given path component (may be null)
-
getChildValues
Returns the values for the direct children of this node.- Returns:
- the values for the direct children
-
getChildValues
Gets the child values for the given path.- Parameters:
path
- the path- Returns:
- the child values
-
getDescendantValues
Gets the descendant values.- Parameters:
path
- the path- Returns:
- the descendant values
-
getValue
Gets the value for this node (may be null).- Returns:
- the value
-
getValue
Gets the value for the sub-path given, starting from this node.- Parameters:
path
- the path- Returns:
- the value for the node
-
setValue
Sets the value for the sub-path given, starting from this node.- Parameters:
path
- the pathvalue
- the value to set
-
setValue
Sets the value for this node.- Parameters:
value
- the value for the node
-