public DTMAxisIterator cloneIterator() { final AxisIterator clone = new AxisIterator(_axis, _type); if (_source != null) { clone._source = _source.cloneIterator(); } clone._dtmId = _dtmId; return clone; } } // end of AxisIterator
/** * Standard function position() * @deprecated This method exists only for backwards compatibility with old * translets. New code should not reference it. */ public static int positionF(DTMAxisIterator iterator) { return iterator.isReverse() ? iterator.getLast() - iterator.getPosition() + 1 : iterator.getPosition(); }
public DTMAxisIterator reset() { _source.reset(); // Special case for //* path - see ParentLocationPath _iterator.setStartNode(_includeSelf ? _startNode : _source.next()); return resetPosition(); }
public DTMAxisIterator setStartNode(int node) { if (_isRestartable) { // iterator is not a clone _source.setStartNode(node); // Calculate the position of the node in the set _position = 1; while ((node = _source.next()) != END && node != _match) { _position++; } } return this; }
iter.setStartNode(dtmRoot); DTMIterator iterator = new OneStepIterator(iter, Axis.SELF); iterator.setRoot(dtmRoot, xctxt); iterator.setRoot(iter.getStartNode(), xctxt); result = new XNodeSet(iterator);
public DTMAxisIterator reset() { _source.reset(); _ready = true; return this; }
/** * Get the next node via getFirstAttribute && getNextAttribute. */ protected int getNextNode() { return m_lastFetched = m_iterator.next(); }
public DTMAxisIterator setStartNode(final int node) { if (_isRestartable) { _source.setStartNode(node); _ready = true; } return this; }
/** * Tells if this is a reverse axes. Overrides AxesWalker#isReverseAxes. * * @return true for this class. */ public boolean isReverseAxes() { return m_iterator.isReverse(); }
/** * XSLT Standard function string(value) */ public static String stringF(Object obj, DOM dom) { if (obj instanceof DTMAxisIterator) { return dom.getStringValueX(((DTMAxisIterator)obj).reset().next()); } else if (obj instanceof Node) { return dom.getStringValueX(((Node)obj).node); } else if (obj instanceof DOM) { return ((DOM)obj).getStringValue(); } else { return obj.toString(); } }
public DTMAxisIterator cloneIterator() { _isRestartable = false; try { final StepIterator clone = (StepIterator) super.clone(); clone._source = _source.cloneIterator(); clone._iterator = _iterator.cloneIterator(); clone._iterator.setRestartable(true); // must be restartable clone._isRestartable = false; return clone.reset(); } catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; } }
public void gotoMark() { if (_source != null) { _source.gotoMark(); } }
public int getLast() { if (_source != null) { return _source.getLast(); } else { return END; } }
public int getPosition() { if (_source != null) { return _source.getPosition(); } else { return END; } }
public int next() { if (_ready) { _ready = false; return _source.getNodeByPosition(_position); } return DTMAxisIterator.END; /* if (_ready && _position > 0) { final int pos = _source.isReverse() ? _source.getLast() - _position + 1 : _position; _ready = false; int node; while ((node = _source.next()) != DTMAxisIterator.END) { if (pos == _source.getPosition()) { return node; } } } return DTMAxisIterator.END; */ }
iter.setStartNode(dtmRoot); DTMIterator iterator = new OneStepIterator(iter, Axis.SELF); iterator.setRoot(dtmRoot, xctxt); iterator.setRoot(iter.getStartNode(), xctxt); result = new XNodeSet(iterator);
public DTMAxisIterator setStartNode(int node) { if (_isRestartable) { // Set start node for left-hand iterator... _source.setStartNode(_startNode = node); // ... and get start node for right-hand iterator from left-hand, // with special case for //* path - see ParentLocationPath _iterator.setStartNode(_includeSelf ? _startNode : _source.next()); return resetPosition(); } return this; }
public DTMAxisIterator reset() { if (_source != null) { _source.reset(); } return this; }
public int next() { if (_source == null) { return(END); } return _source.next(); }
public DTMAxisIterator setStartNode(int node) { if (_isRestartable) { _startNode = node; _source.setStartNode(node); resetPosition(); _isRestartable = false; } return this; }