/** * Traverse to the next node after the current node that is matched * by the expanded type ID. * * @param context The context node of this iteration. * @param current The current node of the iteration. * @param expandedTypeID The expanded type ID that must match. * * @return the next node in the iteration, or DTM.NULL. */ public int next(int context, int current, int expandedTypeID) { // Compute in ID space int subtreeRootIdent = makeNodeIdentity(context); for (current = makeNodeIdentity(current) + 1; ; current++) { int exptype = _exptype(current); // may call nextNode() if (exptype == NULL) return NULL; if (exptype != expandedTypeID) continue; return makeNodeHandle(current); // make handle. } } }
/** * Get the first of the following. * * @param context The context node of this traversal. This is the point * that the traversal starts from. * @return the first node in the traversal. */ public int first(int context) { // Compute in ID space context=makeNodeIdentity(context); int first; int type = _type(context); if ((DTM.ATTRIBUTE_NODE == type) || (DTM.NAMESPACE_NODE == type)) { context = _parent(context); first = _firstch(context); if (NULL != first) return makeNodeHandle(first); } do { first = _nextsib(context); if (NULL == first) context = _parent(context); } while (NULL == first && NULL != context); return makeNodeHandle(first); }
/** * Get the first potential identity that can be returned. * @param handle handle to the root context. * @return identity of the root of the subtree. */ protected int getSubtreeRoot(int handle) { // %REVIEW% Shouldn't this always be 0? return makeNodeIdentity(getDocument()); }
/** * 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)); }
/** * Traverse to the next node after the current node. * * @param context The context node of this iteration. * @param current The current node of the iteration. * * @return the next node in the iteration, or DTM.NULL. */ public int next(int context, int current) { return (context == current) ? getFirstAttribute(context) : getNextAttribute(current); }
/** * Traverse to the next node after the current node. * * @param context The context node of this iteration. * @param current The current node of the iteration. * * @return the next node in the iteration, or DTM.NULL. */ public int next(int context, int current) { // Compute in ID space int subtreeRootIdent = makeNodeIdentity(context ); for (current = makeNodeIdentity(current) - 1; current >= 0; current--) { short type = _type(current); if (ATTRIBUTE_NODE == type || NAMESPACE_NODE == type) continue; return makeNodeHandle(current); // make handle. } return NULL; }
/** * Traverse to the next node after the current node that is matched * by the expanded type ID. * * @param context The context node of this iteration. * @param current The current node of the iteration. * @param expandedTypeID The expanded type ID that must match. * * @return the next node in the iteration, or DTM.NULL. */ public int next(int context, int current, int expandedTypeID) { // Process in Identifier space for (current = _nextsib(makeNodeIdentity(current)); DTM.NULL != current; current = _nextsib(current)) { if (m_exptype.elementAt(current) == expandedTypeID) return makeNodeHandle(current); } return NULL; } }
int next = findElementFromIndex(nsIndex, lnIndex, nextPotential); break; nextNode();
/** * Traverse to the next node after the current node that is matched * by the expanded type ID. * * @param context The context node of this iteration. * @param current The current node of the iteration. * @param expandedTypeID The expanded type ID that must match. * * @return the next node in the iteration, or DTM.NULL. */ public int next(int context, int current, int expandedTypeID) { current = (context == current) ? getFirstAttribute(context) : getNextAttribute(current); do { if (getExpandedTypeID(current) == expandedTypeID) return current; } while (DTM.NULL != (current = getNextAttribute(current))); return NULL; } }
int identity = makeNodeIdentity(context); int firstMatch = getNextIndexed(identity, _firstch(identity), expandedTypeID); return makeNodeHandle(firstMatch); for (int current = _firstch(makeNodeIdentity(context)); DTM.NULL != current; current = _nextsib(current))
/** * Return the root if it matches the expanded type ID, * else return null (nothing found) * * @param context The context node of this traversal. * @param expandedTypeID The expanded type ID that must match. * * @return the first node in the traversal. */ public int first(int context, int expandedTypeID) { int root=getDocumentRoot(context); return (getExpandedTypeID(root) == expandedTypeID) ? root : NULL; }
/** * Tell if this node identity is a descendant. Assumes that * the node info for the element has already been obtained. * * %REVIEW% This is really parentFollowsRootInDocumentOrder ... * which fails if the parent starts after the root ends. * May be sufficient for this class's logic, but misleadingly named! * * @param subtreeRootIdentity The root context of the subtree in question. * @param identity The index number of the node in question. * @return true if the index is a descendant of _startNode. */ protected boolean isDescendant(int subtreeRootIdentity, int identity) { return _parent(identity) >= subtreeRootIdentity; }
/** * By the nature of the stateless traversal, the context node can not be * returned or the iteration will go into an infinate loop. So to traverse * an axis, the first function must be used to get the first node. * * <p>This method needs to be overloaded only by those axis that process * the self node. <\p> * * @param context The context node of this traversal. This is the point * of origin for the traversal -- its "root node" or starting point. * @param expandedTypeID The expanded type ID that must match. * * @return the first node in the traversal. */ public int first(int context, int expandedTypeID) { if (isIndexed(expandedTypeID)) { int identity = 0; int firstPotential = getFirstPotential(identity); return makeNodeHandle(getNextIndexed(identity, firstPotential, expandedTypeID)); } int root = getDocumentRoot(context); return next(root, root, expandedTypeID); }
/** * Traverse to the next node after the current node that is matched * by the expanded type ID. * * @param context The context node of this iteration. * @param current The current node of the iteration. * @param expandedTypeID The expanded type ID that must match. * * @return the next node in the iteration, or DTM.NULL. */ public int next(int context, int current, int expandedTypeID) { while (DTM.NULL != (current = getPreviousSibling(current))) { if (getExpandedTypeID(current) == expandedTypeID) return current; } return NULL; } }
/** * Traverse to the next node after the current node that is matched * by the expanded type ID. * * @param context The context node of this iteration. * @param current The current node of the iteration. * @param expandedTypeID The expanded type ID that must match. * * @return the next node in the iteration, or DTM.NULL. */ public int next(int context, int current, int expandedTypeID) { while (DTM.NULL != (current = getNextSibling(current))) { if (getExpandedTypeID(current) == expandedTypeID) return current; } return NULL; } }
/** * Return the root. * * @param context The context node of this traversal. * * @return the first node in the traversal. */ public int first(int context) { return getDocumentRoot(context); }
/** * 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); }
/** * By the nature of the stateless traversal, the context node can not be * returned or the iteration will go into an infinate loop. To see if * the self node should be processed, use this function. If the context * node does not match the expanded type ID, this function will return * false. * * @param context The context node of this traversal. * @param expandedTypeID The expanded type ID that must match. * * @return the first node in the traversal. */ public int first(int context, int expandedTypeID) { return (getExpandedTypeID(context) == expandedTypeID) ? context : NULL; }
/** * Traverse to the next node after the current node. * * @param context The context node of this iteration. * @param current The current node of the iteration. * * @return the next node in the iteration, or DTM.NULL. */ public int next(int context, int current) { // Compute in ID space int subtreeRootIdent = makeNodeIdentity(context); for (current = makeNodeIdentity(current) + 1; ; current++) { // Kluge test: Just make sure +1 yielded a real node int type = _type(current); // may call nextNode() if (type == NULL) return NULL; return makeNodeHandle(current); // make handle. } }
/** * Traverse to the next node after the current node that is matched * by the expanded type ID. * * @param context The context node of this iteration. * @param current The current node of the iteration. * @param expandedTypeID The expanded type ID that must match. * * @return the next node in the iteration, or DTM.NULL. */ public int next(int context, int current, int expandedTypeID) { // Process in Identifier space for (current = _nextsib(makeNodeIdentity(current)); DTM.NULL != current; current = _nextsib(current)) { if (m_exptype.elementAt(current) == expandedTypeID) return makeNodeHandle(current); } return NULL; } }