Class PathMap<T>
- java.lang.Object
-
- org.apache.jackrabbit.spi.commons.name.PathMap<T>
-
public class PathMap<T> extends Object
Generic path map that associates information with the individual path elements of a path.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PathMap.Element<T>
Internal class holding the object associated with a certain path element.static interface
PathMap.ElementVisitor<T>
Element visitor used intraverse(org.apache.jackrabbit.spi.commons.name.PathMap.ElementVisitor<T>, boolean)
-
Constructor Summary
Constructors Constructor Description PathMap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PathMap.Element<T>
map(Path path, boolean exact)
Map a path to a child.PathMap.Element<T>
put(Path path)
Create an empty child given by its path.void
put(Path path, PathMap.Element<T> element)
Put an element given by its path.PathMap.Element<T>
put(Path path, T obj)
Create an element given by its path.void
traverse(PathMap.ElementVisitor<T> visitor, boolean includeEmpty)
Traverse the path map and call back requester.
-
-
-
Method Detail
-
map
public PathMap.Element<T> map(Path path, boolean exact)
Map a path to a child. Ifexact
isfalse
, returns the last available item along the path that is stored in the map.- Parameters:
path
- path to mapexact
- flag indicating whether an exact match is required- Returns:
- child, maybe
null
ifexact
istrue
-
put
public PathMap.Element<T> put(Path path, T obj)
Create an element given by its path. The path map will create any necessary intermediate elements.- Parameters:
path
- path to childobj
- object to store at destination
-
put
public void put(Path path, PathMap.Element<T> element)
Put an element given by its path. The path map will create any necessary intermediate elements.- Parameters:
path
- path to childelement
- element to store at destination
-
put
public PathMap.Element<T> put(Path path)
Create an empty child given by its path.- Parameters:
path
- path to child
-
traverse
public void traverse(PathMap.ElementVisitor<T> visitor, boolean includeEmpty)
Traverse the path map and call back requester. This method visits the root first, then its children.- Parameters:
includeEmpty
- iftrue
invoke call back on every child regardless, whether the associated object is empty or not; otherwise call back on non-empty children only
-
-