/** * Get the subtree root identity from the handle that was passed in by * the caller. Derived classes may override this to change the root * context of the traversal. * * @param handle handle to the root context. * @return identity of the root of the subtree. */ protected int getSubtreeRoot(int handle) { return makeNodeIdentity(handle); }
/** * Get the subtree root identity from the handle that was passed in by * the caller. Derived classes may override this to change the root * context of the traversal. * * @param handle handle to the root context. * @return identity of the root of the subtree. */ protected int getSubtreeRoot(int handle) { return makeNodeIdentity(handle); }
/** * 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()); }
/** * 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()); }
/** * 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. * * @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) { // Compute in ID space int subtreeRootIdent = makeNodeIdentity(context); for (current = makeNodeIdentity(current) - 1; current >= 0; current--) { int exptype = m_exptype.elementAt(current); if (exptype != expandedTypeID) continue; return makeNodeHandle(current); // make handle. } return 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 >= 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. * * @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) { // 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. } } }
/** * 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 || isAncestor(subtreeRootIdent, current)) 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) { // Compute in ID space int subtreeRootIdent = makeNodeIdentity(context); for (current = makeNodeIdentity(current) - 1; current >= 0; current--) { int exptype = m_exptype.elementAt(current); if (exptype != expandedTypeID || isAncestor(subtreeRootIdent, current)) continue; return makeNodeHandle(current); // make handle. } return 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) { int subtreeRootIdent = makeNodeIdentity(context); for (current = makeNodeIdentity(current) + 1; ; current++) { // Trickological code: _exptype() has the side-effect of // running nextNode until the specified node has been loaded, // and thus can be used to ensure that incremental construction of // the DTM has gotten this far. Using it just for that side-effect // is quite a kluge... _exptype(current); // make sure it's here. if (!isDescendant(subtreeRootIdent, current)) return NULL; return makeNodeHandle(current); // make handle. } } }
/** * 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 identity space current=makeNodeIdentity(current); while (true) { current++; // Only works on IDs, not handles. // %REVIEW% Are we using handles or indexes? int type = _type(current); // may call nextNode() if (NULL == type) return NULL; if (ATTRIBUTE_NODE == type || NAMESPACE_NODE == type) continue; 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) { // Compute in ID space current=makeNodeIdentity(current); while (true) { current++; int etype = _exptype(current); // may call nextNode() if (NULL == etype) return NULL; if (etype != expandedTypeID) continue; 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 using identities current = makeNodeIdentity(current); while (DTM.NULL != (current = m_parent.elementAt(current))) { if (m_exptype.elementAt(current) == expandedTypeID) return makeNodeHandle(current); } return NULL; } }
/** * 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 current, int expandedTypeID) { // Compute in ID space current = makeNodeIdentity(current); while (NULL != (current = m_parent.elementAt(current))) { if (m_exptype.elementAt(current) == expandedTypeID) return makeNodeHandle(current); } return 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) { int subtreeRootIdent = getSubtreeRoot(context); for (current = makeNodeIdentity(current) + 1; ; current++) { int type = _type(current); // may call nextNode() if (!isDescendant(subtreeRootIdent, current)) return NULL; if (ATTRIBUTE_NODE == type || NAMESPACE_NODE == type) continue; 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; } }
/** * 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) { int subtreeRootIdent = getSubtreeRoot(context); for (current = makeNodeIdentity(current) + 1; ; current++) { int type = _type(current); // may call nextNode() if (!isDescendant(subtreeRootIdent, current)) return NULL; if (ATTRIBUTE_NODE == type || NAMESPACE_NODE == type) continue; return makeNodeHandle(current); // make handle. } }