/*
(non-Javadoc)

@see org.apache.lucene.search.DocIdSetIterator#advance(int)
976178
@Override
  public int advance(int target) throws IOException {
    reset();
    if (docId == NO_MORE_DOCS) {
      return docId;
    } else if (target < docId) {
      // should not happen
      docId = NO_MORE_DOCS;
      return docId;
    } else {
      // advance 1
      int spans1DocId = spans1.spans.docID();
      int newTarget = target;
      if (spans1DocId < newTarget) {
        spans1DocId = spans1.spans.advance(target);
        if (spans1DocId == NO_MORE_DOCS) {
          docId = NO_MORE_DOCS;
          return docId;
        }
        newTarget = Math.max(newTarget, spans1DocId);
      }
      int spans2DocId = spans2.spans.docID();
      // advance 2
      if (spans2DocId < newTarget) {
        spans2DocId = spans2.spans.advance(newTarget);
        if (spans2DocId == NO_MORE_DOCS) {
          docId = NO_MORE_DOCS;
          return docId;
        }
      }
      // check equal docId, otherwise next
      if (spans1DocId == spans2DocId) {
        docId = spans1DocId;
        // check match
        if (goToNextStartPosition()) {
          return docId;
        } else {
          return nextDoc();
        }
      } else {
        return nextDoc();
      }
    }
  }
219259
func advance(parser *Parser) error {
	parser.PrevEnd = parser.Token.End
	token, err := parser.LexToken(parser.PrevEnd)
	if err != nil {
		return err
	}
	parser.Token = token
	return nil
}
659572
def advance(self):
        """"""
        self.cursor += 1
        if self.cursor >= len(self.raw):
            self.char = None
        else:
            self.char = self.raw[self.cursor]
464575
void advance()
        {
            // we are always at the leaf level when this method is invoked
            // so we calculate the seed for generating the row by combining the seed that generated the clustering components
            int depth = clusteringComponents.length - 1;
            long parentSeed = clusteringSeeds[depth];
            long rowSeed = seed(clusteringComponents[depth].peek(), generator.clusteringComponents.get(depth).type, parentSeed);

            // and then fill the row with the _non-clustering_ values for the position we _were_ at, as this is what we'll deliver
            for (int i = clusteringSeeds.length ; i < row.row.length ; i++)
            {
                Generator gen = generator.valueComponents.get(i - clusteringSeeds.length);
                gen.setSeed(rowSeed);
                row.row[i] = gen.generate();
            }

            // then we advance the leaf level
            setHasNext(advance(depth, false));
        }
948997
@Override
    public boolean advance() {
        if (currentMutation != NON_MUTATION_1) { // Prevents invocation on the first execution of the method

            // This will be executed starting from the second call of the advance() method
            if (currentMutation != NON_MUTATION) {
                switch (Mutation.getRawTypeCode(currentMutation)) {
                    case RAW_MUTATION_TYPE_SUBSTITUTION:
                        ++seq1Position;
                        ++seq2Position;
                        break;

                    case RAW_MUTATION_TYPE_DELETION:
                        ++seq1Position;
                        break;

                    case RAW_MUTATION_TYPE_INSERTION:
                        ++seq2Position;
                        break;
                }
                ++mutationsPointer;
            } else {
                ++seq1Position;
                ++seq2Position;
            }

        }

        // Setting current state
        currentMutation = mutationsPointer < mutations.size() &&
                mutations.getPositionByIndex(mutationsPointer) == seq1Position ? mutations.getMutation(mutationsPointer) :
                NON_MUTATION;

        return seq1Position < seq1To || currentMutation != NON_MUTATION;
    }
937921
func (p *Parser) advance() bool {
	r := p.next()
	if r == '\\' {
		p.next()
	} else if isTerminator(r) {
		p.backup()
		return false
	}
	return true
}
870467
def _advance(self):
        
        cur_val = None if self.cur_token is None else self.cur_token.value
        try:
            self.cur_token = next(self._tokenizer)
        except StopIteration:
            self.cur_token = None
        return cur_val
767200
private boolean advance(int tokens) {
	while (buffer.size() < tokens && tokenizer.hasNext())
	    buffer.add(tokenizer.next());
	return buffer.size() >= tokens;
    }
578368
void advance() {
    if (tc.isEntryEnabled())
      tc.entry(this,cclass, "advance");
    if (!prefixDone) {
      Pattern.Clause prefix = pattern.getPrefix();
      if (prefix == null || next >= prefix.items.length) {
        Pattern.Clause suffix = pattern.getSuffix();
        if (suffix != null && suffix != prefix) {
          // SWITCH_TO_SUFFIX
          prefixDone = true;
          next = suffix.items.length-1;
        }
        // else in one of the FINAL_ states, so do nothing
      }
      else
        // somewhere in the body of the prefix, so advance by incrementing
        next++;
    }
    else
      // somewhere in the suffix, so advance by decrementing
      next--;
    if (tc.isEntryEnabled())
      tc.exit(this,cclass, "advance");
  }
812681
public Document next() {
        if (!hasNext())
            throw new NoSuchElementException("No further documents");
        if (bufferError != null)
            throw bufferError;
        try {
            return documentsToReturn.take();
        } catch (InterruptedException ie) {
            throw new IOError(ie);
        }
    }
896306
public boolean setCharAdvance(int c, int advance) {
        byte b[] = convertToBytes(c);
        if (b.length == 0)
            return false;
        widths[0xff & b[0]] = advance;
        return true;
    }
297516
@Override
  public int nextDoc() throws IOException {
    IndexDoc indexDoc = mtasCodecInfo.getNextDoc(field, docId);
    if (indexDoc != null) {
      docId = indexDoc.docId;
      minPosition = indexDoc.minPosition;
      maxPosition = indexDoc.maxPosition;
      currentStartPosition = -1;
      currentEndPosition = -1;
    } else {
      docId = NO_MORE_DOCS;
      minPosition = NO_MORE_POSITIONS;
      maxPosition = NO_MORE_POSITIONS;
      currentStartPosition = NO_MORE_POSITIONS;
      currentEndPosition = NO_MORE_POSITIONS;
    }
    return docId;
  }
43867
private void advance() {
        if (current == null || !current.hasNext()) {
            do {
                current = iters.poll();
            } while (current != null && !current.hasNext());
        }
    }
1344434
@Override
  public int advance(int target) throws IOException {
    resetQueue();
    return (spans.advance(target) == NO_MORE_DOCS) ? NO_MORE_DOCS
        : toMatchDoc();
  }
822036
private JsonToken advance() throws IOException {
        peek();

        JsonToken result = token;
        token = null;
        value = null;
        name = null;
        return result;
    }
127265
void advance(SimpleDependencyPath path) {
        if (path.length() >= maxPathLength)
            return;

        // Get the last node and last relation to decide how to expand.
        DependencyRelation lastRelation = path.lastRelation();
        DependencyTreeNode last = path.last(); 
        
        // Expand all of the possible relations from the last node, creating a
        // new path for each, except if the relation is the one that generated
        // this path.
        for (DependencyRelation rel : last.neighbors()) {
            // Skip re-adding the current relation
            if (lastRelation.equals(rel) || !acceptor.accept(rel))
                continue;
            SimpleDependencyPath extended = path.extend(rel);
            frontier.offer(extended);
        }
    }
86821
@Override
    public FileEntry next () {
        FileEntry n = this.next;
        try {
            FileEntry ne = advance();
            if ( ne == null ) {
                doClose();
                return n;
            }
            this.next = ne;
        }
        catch ( CIFSException e ) {
            log.warn("Enumeration failed", e);
            this.next = null;
        }
        return n;
    }