gnu.lists
public class TreePosition extends SeqPosition implements Cloneable
Constructor Summary | |
---|---|
TreePosition() | |
TreePosition(Object root) Not a position *in* a sequence, but the current element is the entire sequence. | |
TreePosition(AbstractSequence seq, int index) | |
TreePosition(TreePosition pos) |
Method Summary | |
---|---|
Object | clone() |
void | dump() Copy this position into pos. |
Object | getAncestor(int up) Get the value of an ancestor node. |
int | getDepth() Number of ancestor sequences, including current sequence. |
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) |
Parameters: up the number parents to go up.
Returns: if up is 0, same getNext. Otherwise get parent applied as specified.
Returns: true if there is a child sequence (which might be empty); false if current position is end of sequence or following element is atomic (cannot have children).