| java.lang.Object gnu.lists.SeqPosition gnu.lists.TreePosition
TreePosition | public class TreePosition extends SeqPosition implements Cloneable(Code) | | 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 | |
int | depth Depth of the above stacks.
Note that getDepth returns depth+1; this should perhaps match. | int[] | istack Stack of pushed values for iposition. | AbstractSequence[] | sstack Stack of pushed values for sequence. | Object[] | xstack Stack of pushed values for xposition. |
depth | int depth(Code) | | Depth of the above stacks.
Note that getDepth returns depth+1; this should perhaps match.
|
istack | int[] istack(Code) | | Stack of pushed values for iposition.
|
xstack | Object[] xstack(Code) | | Stack of pushed values for xposition.
|
TreePosition | public TreePosition()(Code) | | |
TreePosition | public TreePosition(Object root)(Code) | | Not a position *in* a sequence, but the current element is the entire sequence.
|
clear | public void clear()(Code) | | |
countPositions | public int countPositions()(Code) | | Implements PositionContainer.
|
finalize | public void finalize()(Code) | | |
getAncestor | public Object getAncestor(int up)(Code) | | Get the value of an ancestor node.
Parameters: up - the number parents to go up. if up is 0, same getNext. Otherwise get parentapplied as specified. |
getDepth | public int getDepth()(Code) | | Number of ancestor sequences, including current sequence.
|
getPositionInt | public int getPositionInt(int positionNumber)(Code) | | Implements PositionContainer.
|
getPositionPtr | public Object getPositionPtr(int positionNumber)(Code) | | Implements PositionContainer.
|
gotoAttributesStart | public boolean gotoAttributesStart()(Code) | | Set position before first attribute (of the element following position).
This is used to iterate through the sequence of attributes.
|
gotoChildrenStart | public boolean gotoChildrenStart()(Code) | | Set position before first child (of the element following position).
true if there is a child sequence (which might be empty);false if current position is end of sequence or following elementis atomic (cannot have children). |
gotoParent | final public boolean gotoParent()(Code) | | |
popNoRelease | public void popNoRelease()(Code) | | |
setPosition | public void setPosition(int positionNumber, int ipos, Object xpos)(Code) | | Implements PositionContainer.
|
setSequence | public void setSequence(int positionNumber, AbstractSequence seq)(Code) | | Implements PositionContainer.
|
|
|