/** * Given a node handle, test if it has child nodes. * <p> %REVIEW% This is obviously useful at the DOM layer, where it * would permit testing this without having to create a proxy * node. It's less useful in the DTM API, where * (dtm.getFirstChild(nodeHandle)!=DTM.NULL) is just as fast and * almost as self-evident. But it's a convenience, and eases porting * of DOM code to DTM. </p> * * @param nodeHandle int Handle of the node. * @return int true if the given node has child nodes. */ public boolean hasChildNodes(int nodeHandle) { int identity = makeNodeIdentity(nodeHandle); int firstChild = _firstch(identity); return firstChild != DTM.NULL; }
/** * Given a node handle, test if it has child nodes. * <p> %REVIEW% This is obviously useful at the DOM layer, where it * would permit testing this without having to create a proxy * node. It's less useful in the DTM API, where * (dtm.getFirstChild(nodeHandle)!=DTM.NULL) is just as fast and * almost as self-evident. But it's a convenience, and eases porting * of DOM code to DTM. </p> * * @param nodeHandle int Handle of the node. * @return int true if the given node has child nodes. */ public boolean hasChildNodes(int nodeHandle) { int identity = makeNodeIdentity(nodeHandle); int firstChild = _firstch(identity); return firstChild != DTM.NULL; }
/** * Given a node handle, get the handle of the node's first child. * If not yet resolved, waits for more nodes to be added to the document and * tries again. * * @param nodeHandle int Handle of the node. * @return int DTM node-number of first child, or DTM.NULL to indicate none exists. */ public int getFirstChild(int nodeHandle) { int identity = makeNodeIdentity(nodeHandle); int firstChild = _firstch(identity); return makeNodeHandle(firstChild); }
/** * Given a node handle, get the handle of the node's first child. * If not yet resolved, waits for more nodes to be added to the document and * tries again. * * @param nodeHandle int Handle of the node. * @return int DTM node-number of first child, or DTM.NULL to indicate none exists. */ public int getFirstChild(int nodeHandle) { int identity = makeNodeIdentity(nodeHandle); int firstChild = _firstch(identity); return makeNodeHandle(firstChild); }
/** * Given a node handle, advance to its last child. * If not yet resolved, waits for more nodes to be added to the document and * tries again. * * @param nodeHandle int Handle of the node. * @return int Node-number of last child, * or DTM.NULL to indicate none exists. */ public int getLastChild(int nodeHandle) { int identity = makeNodeIdentity(nodeHandle); int child = _firstch(identity); int lastChild = DTM.NULL; while (child != DTM.NULL) { lastChild = child; child = _nextsib(child); } return makeNodeHandle(lastChild); }
/** * Given a node handle, advance to its last child. * If not yet resolved, waits for more nodes to be added to the document and * tries again. * * @param nodeHandle int Handle of the node. * @return int Node-number of last child, * or DTM.NULL to indicate none exists. */ public int getLastChild(int nodeHandle) { int identity = makeNodeIdentity(nodeHandle); int child = _firstch(identity); int lastChild = DTM.NULL; while (child != DTM.NULL) { lastChild = child; child = _nextsib(child); } return makeNodeHandle(lastChild); }
int firstChild = _firstch(index);
int firstChild = _firstch(index);
int ch = _firstch(rootID); uppermostNSCandidateID = (ch != DTM.NULL) ? ch : rootID; } else {
int ch = _firstch(rootID); uppermostNSCandidateID = (ch != DTM.NULL) ? ch : rootID; } else {
int node = _firstch(parent); int result = DTM.NULL; while (node != nodeID)
int node = _firstch(parent); int result = DTM.NULL; while (node != nodeID)
/** * Get the first potential identity that can be returned, which is the axis * root context in this case. * * @param identity The node identity of the root context of the traversal. * * @return The identity argument. */ protected int getFirstPotential(int identity) { return _firstch(0); }
/** * Get the first potential identity that can be returned, which is the axis * root context in this case. * * @param identity The node identity of the root context of the traversal. * * @return The identity argument. */ protected int getFirstPotential(int identity) { return _firstch(0); }
/** * @param parm1 * */ protected int _firstch( int parm1 ) { if (DEBUG) System.out.println("_firstch("+parm1+")"); return super._firstch( parm1); }
/** * @param parm1 * */ protected int _firstch( int parm1 ) { if (DEBUG) System.out.println("_firstch("+parm1+")"); return super._firstch( parm1); }
/** * Return the root. * * @param context The context node of this traversal. * * @return the first node in the traversal. */ public int first(int context) { return makeNodeHandle(_firstch(0)); }
/** * Return the root. * * @param context The context node of this traversal. * * @return the first node in the traversal. */ public int first(int context) { return makeNodeHandle(_firstch(0)); }