/** * 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. * * @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. * * @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. * * @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. * * @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. * * @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. * * @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. * * @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; }
/** * 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 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); }
/** * 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. * * @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. * * @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. * * @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. * * @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. * * @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; }