Beispiel #1
0
 public DTMAxisIterator setStartNode(int node) {
   if (_isRestartable) {
     _source.setStartNode(_startNode = node);
     return resetPosition();
   }
   return this;
 }
Beispiel #2
0
    /**
     * Set context node for the iterator. This will cause the iterator to reset itself, reevaluate
     * arguments to the function, look up nodes in the input and reinitialize its internal heap.
     *
     * @param node the context node
     * @return A {@link DTMAxisIterator} set to the start of the iteration.
     */
    public DTMAxisIterator setStartNode(int node) {
      _startNode = node;

      // If the arugment to the function is a node set, set the
      // context node on it.
      if (_keyValueIterator != null) {
        _keyValueIterator = _keyValueIterator.setStartNode(node);
      }

      init();

      return super.setStartNode(node);
    }
  public DTMAxisIterator setStartNode(int node) {
    if (_isRestartable) {
      _source.setStartNode(_startNode = node);

      _nodes.clear();
      while ((node = _source.next()) != END) {
        _nodes.add(node);
      }
      _currentIndex = 0;
      resetPosition();
    }
    return this;
  }