|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.jackrabbit.core.PathMap.Element
Internal class holding the object associated with a certain path element.
Method Summary | |
Object |
get()
Return the object associated with this element |
Iterator |
getChildren()
Return an iterator over all of this element's children. |
int |
getChildrenCount()
Return the children count of this element |
int |
getDepth()
Return the depth of this element. |
int |
getIndex()
Return the non-normalized 1-based index of this element. |
QName |
getName()
Return the name of this element |
int |
getNormalizedIndex()
Return the 1-based index of this element. |
PathMap.Element |
getParent()
Return the parent of this element |
Path |
getPath()
Return the path of this element. |
Path.PathElement |
getPathElement()
Return a path element pointing to this element |
boolean |
hasPath(Path path)
Checks whether this element has the specified path. |
void |
insert(Path.PathElement nameIndex)
Insert an empty child. |
boolean |
isAncestorOf(PathMap.Element other)
Return a flag indicating whether the specified node is a child of this node. |
void |
put(Path.PathElement nameIndex,
PathMap.Element element)
Link a child of this node. |
void |
remove()
Remove this element. |
PathMap.Element |
remove(Path.PathElement nameIndex)
Remove a child. |
void |
removeAll()
Remove all children of this element. |
void |
set(Object obj)
Set the object associated with this element |
void |
traverse(PathMap.ElementVisitor visitor,
boolean includeEmpty)
Recursively invoked traversal method. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public void insert(Path.PathElement nameIndex)
nameIndex
- position where child is insertedpublic void put(Path.PathElement nameIndex, PathMap.Element element)
nameIndex
.
nameIndex
- position where child should be locatedelement
- element to addpublic PathMap.Element remove(Path.PathElement nameIndex)
nameIndex
- child's path element
null
public void remove()
public void removeAll()
public Object get()
public void set(Object obj)
obj
- object associated with this elementpublic QName getName()
public int getIndex()
getNormalizedIndex()
public int getNormalizedIndex()
getIndex()
except that an index value of 0
is automatically converted to 1.
public Path.PathElement getPathElement()
public Path getPath() throws MalformedPathException
MalformedPathException
- if building the path failspublic boolean hasPath(Path path)
MalformedPathException
for simple
path comparisons.
path
- path to compare to
true
if this child has the path
path
, false
otherwisepublic void traverse(PathMap.ElementVisitor visitor, boolean includeEmpty)
visitor
- visitor to invokeincludeEmpty
- if true
invoke call back on every
element regardless, whether the associated object is empty
or not; otherwise call back on non-empty children onlypublic int getDepth()
0
for the
root element and n + 1
for some element if the depth of
its parent is n
.
public boolean isAncestorOf(PathMap.Element other)
other
- node to checkpublic PathMap.Element getParent()
null
if this is the root elementpublic int getChildrenCount()
public Iterator getChildren()
#Element
.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |