/** * Get the analysis bits for this walker, as defined in the WalkerFactory. * @return One of WalkerFactory#BIT_DESCENDANT, etc. */ public int getAnalysisBits() { int bits = 0; if (null != m_firstWalker) { AxesWalker walker = m_firstWalker; while (null != walker) { int bit = walker.getAnalysisBits(); bits |= bit; walker = walker.getNextWalker(); } } return bits; }
/** * This function is used to fixup variables from QNames to stack frame * indexes at stylesheet build time. * @param vars List of QNames that correspond to variables. This list * should be searched backwards for the first qualified name that * corresponds to the variable reference qname. The position of the * QName in the vector from the start of the vector will be its position * in the stack frame (but variables above the globalsTop value will need * to be offset to the current stack frame). */ public void fixupVariables(java.util.Vector vars, int globalsSize) { m_predicateIndex = -1; AxesWalker walker = m_firstWalker; while (null != walker) { walker.fixupVariables(vars, globalsSize); walker = walker.getNextWalker(); } }
/** * @see Expression#deepEquals(Expression) */ public boolean deepEquals(Expression expr) { if (!super.deepEquals(expr)) return false; AxesWalker walker1 = m_firstWalker; AxesWalker walker2 = ((WalkingIterator)expr).m_firstWalker; while ((null != walker1) && (null != walker2)) { if(!walker1.deepEquals(walker2)) return false; walker1 = walker1.getNextWalker(); walker2 = walker2.getNextWalker(); } if((null != walker1) || (null != walker2)) return false; return true; }
/** * This function is used to fixup variables from QNames to stack frame * indexes at stylesheet build time. * @param vars List of QNames that correspond to variables. This list * should be searched backwards for the first qualified name that * corresponds to the variable reference qname. The position of the * QName in the vector from the start of the vector will be its position * in the stack frame (but variables above the globalsTop value will need * to be offset to the current stack frame). */ public void fixupVariables(java.util.Vector vars, int globalsSize) { m_predicateIndex = -1; AxesWalker walker = m_firstWalker; while (null != walker) { walker.fixupVariables(vars, globalsSize); walker = walker.getNextWalker(); } }
/** * @see Expression#deepEquals(Expression) */ public boolean deepEquals(Expression expr) { if (!super.deepEquals(expr)) return false; AxesWalker walker1 = m_firstWalker; AxesWalker walker2 = ((WalkingIterator)expr).m_firstWalker; while ((null != walker1) && (null != walker2)) { if(!walker1.deepEquals(walker2)) return false; walker1 = walker1.getNextWalker(); walker2 = walker2.getNextWalker(); } if((null != walker1) || (null != walker2)) return false; return true; }
/** * Get the analysis bits for this walker, as defined in the WalkerFactory. * @return One of WalkerFactory#BIT_DESCENDANT, etc. */ public int getAnalysisBits() { int bits = 0; if (null != m_firstWalker) { AxesWalker walker = m_firstWalker; while (null != walker) { int bit = walker.getAnalysisBits(); bits |= bit; walker = walker.getNextWalker(); } } return bits; }
/** * Count the steps in a given location path. * * @param lpi The location path iterator that owns the steps. * @return The number of steps in the given location path. */ protected int countSteps(LocPathIterator lpi) { if(lpi instanceof WalkingIterator) { WalkingIterator wi = (WalkingIterator)lpi; AxesWalker aw = wi.getFirstWalker(); int count = 0; while(null != aw) { count++; aw = aw.getNextWalker(); } return count; } else return 1; }
/** * Count the steps in a given location path. * * @param lpi The location path iterator that owns the steps. * @return The number of steps in the given location path. */ protected int countSteps(LocPathIterator lpi) { if(lpi instanceof WalkingIterator) { WalkingIterator wi = (WalkingIterator)lpi; AxesWalker aw = wi.getFirstWalker(); int count = 0; while(null != aw) { count++; aw = aw.getNextWalker(); } return count; } else return 1; }
/** * Detaches the iterator from the set which it iterated over, releasing * any computational resources and placing the iterator in the INVALID * state. After<code>detach</code> has been invoked, calls to * <code>nextNode</code> or<code>previousNode</code> will raise the * exception INVALID_STATE_ERR. */ public void detach() { if(m_allowDetach) { AxesWalker walker = m_firstWalker; while (null != walker) { walker.detach(); walker = walker.getNextWalker(); } m_lastUsedWalker = null; // Always call the superclass detach last! super.detach(); } }
/** * Detaches the iterator from the set which it iterated over, releasing * any computational resources and placing the iterator in the INVALID * state. After<code>detach</code> has been invoked, calls to * <code>nextNode</code> or<code>previousNode</code> will raise the * exception INVALID_STATE_ERR. */ public void detach() { if(m_allowDetach) { AxesWalker walker = m_firstWalker; while (null != walker) { walker.detach(); walker = walker.getNextWalker(); } m_lastUsedWalker = null; // Always call the superclass detach last! super.detach(); } }
walker = walker.getNextWalker(); else boolean isLastWalker = (null == walker.getNextWalker()); if(isLastWalker)
return false; aw1 = aw1.getNextWalker(); aw2 = aw2.getNextWalker();
return false; aw1 = aw1.getNextWalker(); aw2 = aw2.getNextWalker();
walker = walker.getNextWalker(); else boolean isLastWalker = (null == walker.getNextWalker()); if(isLastWalker)
if((aw instanceof FilterExprWalker) && (null == aw.getNextWalker()))
if((aw instanceof FilterExprWalker) && (null == aw.getNextWalker()))
for(int i = 1; i < numSteps; i++) AxesWalker next = (AxesWalker)walker.getNextWalker().clone(); walker.setNextWalker(next); next.setLocPathIterator(newIter);
for(int i = 1; i < numSteps; i++) AxesWalker next = (AxesWalker)walker.getNextWalker().clone(); walker.setNextWalker(next); next.setLocPathIterator(newIter);
walker = walker.getNextWalker();
walker = walker.getNextWalker();