|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gnu.lists.SeqPosition gnu.lists.TreePosition
public class TreePosition
A position that can also go down and up in a tree. A TreePosition is a stack of positions. The "current" position (i.e. the one you get if you tree the TreePosition as a SeqPosition) is that in the innermost containing sequence. Normally, the "current" element is (the one following) a position in a sequence. As a special (initial case), we may want to treat the entire sequence is the "current element". This is represented by depth==-1 and xpos set to the root element (which need not actually be a sequence).
Field Summary |
---|
Fields inherited from class gnu.lists.SeqPosition |
---|
ipos, sequence |
Constructor Summary | |
---|---|
TreePosition()
|
|
TreePosition(AbstractSequence seq,
int index)
|
|
TreePosition(java.lang.Object root)
Not a position *in* a sequence, but the current element is the entire sequence. |
|
TreePosition(TreePosition pos)
|
Method Summary | |
---|---|
java.lang.Object |
clone()
|
void |
dump()
Copy this position into pos. |
java.lang.Object |
getAncestor(int up)
Get the value of an ancestor node. |
int |
getDepth()
Number of ancestor sequences, including current sequence. |
java.lang.Object |
getPosNext()
|
AbstractSequence |
getRoot()
Get the "root document". |
boolean |
gotoAttributesStart()
Set position before first attribute (of the element following position). |
boolean |
gotoChildrenStart()
Set position before first child (of the element following position). |
boolean |
gotoParent()
|
void |
pop()
|
void |
popNoRelease()
|
void |
push(AbstractSequence child,
int iposChild)
|
void |
release()
|
void |
set(TreePosition position)
|
Methods inherited from class gnu.lists.SeqPosition |
---|
add, copy, finalize, fromEndIndex, getContainingSequenceSize, getNext, getNextKind, getNextTypeName, getNextTypeObject, getPos, getPrevious, gotoEnd, gotoNext, gotoPrevious, gotoStart, hasMoreElements, hasNext, hasPrevious, isAfter, make, next, nextElement, nextIndex, previous, previousIndex, remove, set, set, set, setNext, setPos, setPos, setPrevious, toInfo, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TreePosition()
public TreePosition(java.lang.Object root)
public TreePosition(AbstractSequence seq, int index)
public TreePosition(TreePosition pos)
Method Detail |
---|
public java.lang.Object clone()
clone
in class java.lang.Object
public void set(TreePosition position)
public int getDepth()
public AbstractSequence getRoot()
public java.lang.Object getPosNext()
public void push(AbstractSequence child, int iposChild)
public void pop()
public void popNoRelease()
public final boolean gotoParent()
public boolean gotoChildrenStart()
gotoChildrenStart
in class SeqPosition
public boolean gotoAttributesStart()
public java.lang.Object getAncestor(int up)
up
- the number parents to go up.
public void release()
release
in class SeqPosition
public void dump()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |