Returns the next RevisionTask.

@return RevisionTask.

@throws ArticleReaderException
if the parsing of the input fails
337242
public Task<Revision> next()
		throws ArticleReaderException
	{

		try {
			this.keywords.reset();

			// if new article read header, otherwise use old one
			if (this.lastTaskCompleted) {
				this.lastTaskCompleted = false;

				this.taskPartCounter = 1;
				this.taskRevisionCounter = -1;

				if (!readHeader()) {

					this.lastTaskCompleted = true;
					return null;

				}
			}
			else {
				this.taskPartCounter++;
			}

			Task<Revision> task = new Task<Revision>(this.taskHeader,
					this.taskPartCounter);
			task.add(readRevision());

			int r = read();
			while (r != -1) {
				if (this.keywords.check((char) r)) {

					switch (this.keywords.getValue()) {

					case KEY_START_REVISION:

						if (task.byteSize() >= LIMIT_TASK_SIZE_REVISIONS) {
							this.lastTaskCompleted = false;

							if (this.taskPartCounter == 1) {
								task.setTaskType(TaskTypes.TASK_PARTIAL_FIRST);
							}
							else {
								task.setTaskType(TaskTypes.TASK_PARTIAL);
							}

							return task;
						}

						task.add(readRevision());
						break;

					case KEY_END_PAGE:

						this.lastTaskCompleted = true;
						if (this.taskPartCounter > 1) {
							task.setTaskType(TaskTypes.TASK_PARTIAL_LAST);
						}

						return task;

					default:
						throw new IOException();
					}

					this.keywords.reset();
				}

				r = read();
			}

			throw ErrorFactory
					.createArticleReaderException(ErrorKeys.DELTA_CONSUMERS_TASK_READER_WIKIPEDIAXMLREADER_UNEXPECTED_END_OF_FILE);

		}
		catch (ArticleReaderException e) {
			throw e;
		}
		catch (Exception e) {
			throw new ArticleReaderException(e);
		}
	}
804086
public String next() {
        if (!hasNext()) {
            throw new NoSuchElementException();
        }

        String next = this.next;
        this.next = fetchNext();

        return next;
    }
1329978
public function next()
    {
        if ((int) $this->current()->query->getValue('o') >= $this->nbPages) {
            return null;
        }

        return $this->getIndexUrl(+1);
    }
533660
protected function getNext()
    {
        if (!$this->current)
        {
            return null;
        }
        if ($this->next !== -1)
        {
            return $this->next;
        }
        $this->load();
        for ($i = 0; $i < count($this->items); $i++)
        {
            if ($this->items[$i]->id == $this->current->id)
            {
                if ($i + 1 < count($this->items))
                {
                    $this->next = $this->items[$i + 1];
                    return $this->next;
                }
                break;
            }
        }
        return null;
    }
989899
protected Revision readRevision()
		throws IOException, ArticleReaderException
	{

		this.taskRevisionCounter++;
		Revision revision = new Revision(this.taskRevisionCounter);

		int size, r = read();
		boolean hasId = false;

		StringBuilder buffer = null;
		this.keywords.reset();

		while (r != -1) {

			if (buffer != null) {
				buffer.append((char) r);
			}

			if (this.keywords.check((char) r)) {
				switch (this.keywords.getValue()) {

				case KEY_START_TEXT:

				case KEY_START_TIMESTAMP:

				case KEY_START_COMMENT:

				case KEY_START_CONTRIBUTOR:
					buffer = new StringBuilder();
					break;

				case KEY_START_ID:
					if (!hasId) {
						buffer = new StringBuilder();
					}
					break;

				case KEY_END_ID:
					if (!hasId) {
						size = buffer.length();
						buffer.delete(size
								- WikipediaXMLKeys.KEY_END_ID.getKeyword()
										.length(), size);

						revision.setRevisionID(Integer.parseInt(buffer
								.toString()));
						buffer = null;

						hasId = true;
					}
					break;

				case KEY_END_TIMESTAMP:
					size = buffer.length();
					buffer.delete(size
							- WikipediaXMLKeys.KEY_END_TIMESTAMP.getKeyword()
									.length(), size);

					revision.setTimeStamp(buffer.toString());
					buffer = null;
					break;

				case KEY_END_TEXT:
					size = buffer.length();
					buffer.delete(size
							- WikipediaXMLKeys.KEY_END_TEXT.getKeyword()
									.length(), size);

					revision.setRevisionText(buffer.toString());
					buffer = null;
					break;

				case KEY_END_COMMENT:
					size = buffer.length();
					buffer.delete(size
							- WikipediaXMLKeys.KEY_END_COMMENT.getKeyword()
									.length(), size);
					//escape comment string
					revision.setComment(SQLEscape.escape(buffer.toString()));
					buffer = null;
					break;

				case KEY_END_CONTRIBUTOR:
					size = buffer.length();
					buffer.delete(size
							- WikipediaXMLKeys.KEY_END_CONTRIBUTOR.getKeyword()
									.length(), size);
					//escape id string
					readContributor(revision, buffer.toString());
					buffer = null;
					break;

				case KEY_MINOR_FLAG:
					revision.setMinor(true);
					buffer = null;
					break;

				case KEY_END_REVISION:
					this.keywords.reset();
					buffer = null;
					return revision;

				//the following cases are handeled in readContributor()
				//they can be skipped here
				case KEY_START_IP:
				case KEY_END_IP:
				case KEY_START_USERNAME:
				case KEY_END_USERNAME:
					break;

				default:
					System.out.println(keywords.getValue());
					throw ErrorFactory
							.createArticleReaderException(ErrorKeys.DELTA_CONSUMERS_TASK_READER_WIKIPEDIAXMLREADER_UNEXPECTED_KEYWORD);
				}

				this.keywords.reset();
			}

			r = read();
		}

		throw ErrorFactory
				.createArticleReaderException(ErrorKeys.DELTA_CONSUMERS_TASK_READER_WIKIPEDIAXMLREADER_UNEXPECTED_END_OF_FILE);
	}
1154141
@Override
    public Sequence<T> nextSequence() {
        Sequence<T> sequence = currentIterator.next();
        sequence.setSequenceId(tagger.getAndIncrement());
        return sequence;
    }
1043656
public E next() {
		if(!hasNext()) {
			throw new NoSuchElementException();
		}
		E retObject = next;
		next = null;
		return retObject;
	}
162248
public function getCurrentRevision()
    {
        if ($this->currentRevision === null) {
            $this->setCurrentRevision($this->revisionRepository->getCurrentByEnvironment($this));
        }
        return $this->currentRevision;
    }
730479
@Override
    public DataStreamingEvent<E> next() throws DataSourceReadException {
        lockChain();
        updateCurrentIterator();
        lastUsedIterator = currentIterator;
        return currentIterator.next();
    }
120126
public LabeledDocument next() {
        LabeledDocument next = nextDoc;
        try {
            advance();
        } catch (IOException ioe) {
            throw new IOError(ioe);
        }
        return next;
    }
532513
def _getNextArticleBatch(self):
        """"""
        eventUri = self.queryParams["eventUri"]
        # move to the next page to download
        self._articlePage += 1
        # if we have already obtained all pages, then exit
        if self._totalPages != None and self._articlePage > self._totalPages:
            return
        if self._er._verboseOutput:
            print("Downloading article page %d from event %s" % (self._articlePage, eventUri))

        self.setRequestedResult(RequestEventArticles(
            page = self._articlePage,
            sortBy = self._articlesSortBy, sortByAsc = self._articlesSortByAsc,
            returnInfo = self._returnInfo,
            **self.queryParams))
        res = self._er.execQuery(self)
        if "error" in res:
            print(res["error"])
        else:
            self._totalPages = res.get(eventUri, {}).get("articles", {}).get("pages", 0)
        arts = res.get(eventUri, {}).get("articles", {}).get("results", [])
        self._articleList.extend(arts)
1326779
public function setPrevNext()
    {
        if ($this->nextNews && $this->prevNews) {
            return $this;
        }
        $entries = $this->entries();

        $isPrev = false;
        $isNext = false;
        $firstNews = false;
        $lastNews = false;

        /** @var NewsInterface $news */
        foreach ($entries as $news) {
            // Obtain th first news.
            if (!$firstNews) {
                $firstNews = $news;
            }
            $lastNews = $news;
            // Find the current news
            if ($news->id() == $this->currentNews()['id']) {
                $isNext = true;
                $isPrev = true;

                continue;
            }
            if (!$isPrev) {
                $this->prevNews = $news;
            }
            // Store the next news
            if ($isNext) {
                $this->nextNews = $news;

                $isNext = false;
            }
        }

        if ($this->entryCycle()) {
            if (!$this->nextNews) {
                $this->nextNews = $firstNews;
            }

            if (!$this->prevNews) {
                $this->prevNews = $lastNews;
            }
        }

        return $this;
    }
841725
public boolean hasNext()
		throws ArticleReaderException
	{

		try {
			if (!this.lastTaskCompleted) {
				return true;
			}

			this.keywords.reset();

			int b = read();
			while (b != -1) {

				if (keywords.check((char) b)) {
					switch (keywords.getValue()) {
					case KEY_START_PAGE:
						// taskStartPosition = bytePosition;
						return true;
					}
					keywords.reset();
				}

				b = read();
			}

			return false;

		}
		catch (Exception e) {
			throw new ArticleReaderException(e);
		}
	}
742456
public function current()
    {
        $leftRow = $this->leftReader->current();

        if (array_key_exists($this->nestKey, $leftRow)) {
            throw new ReaderException(
                sprintf(
                    'Left Row: "%s" Reader already contains a field named "%s". Please choose a different nest key field',
                    $this->key(),
                    $this->nestKey
                )
            );
        }
        $leftRow[$this->nestKey] = [];

        $leftId     = $this->getRowId($leftRow, $this->leftJoinField);
        $rightRow   = $this->rightReader->current();
        $rightId    = $this->getRowId($rightRow, $this->rightJoinField);

        while ($leftId == $rightId && $this->rightReader->valid()) {

            $leftRow[$this->nestKey][] = $rightRow;
            $this->rightReader->next();

            $rightRow = $this->rightReader->current();

            if($this->rightReader->valid()) {
                $rightId = $this->getRowId($rightRow, $this->rightJoinField);
            }
        }

        return $leftRow;
    }
1358580
public function getNext()
    {
        if ($this->currentToken !== null || strlen($this->currentInput) > 0) {
            $this->parseNextToken();

            return $this->currentToken;
        }

        return null;
    }
1245218
@Override
    public LabelledDocument nextDocument() {
        LabelledDocument document = currentIterator.next();
        for (String label : document.getLabels()) {
            labels.storeLabel(label);
        }

        return document;
    }
755357
@Override
    public Sequence<T> nextSequence() {
        Sequence<T> originalSequence = underlyingIterator.nextSequence();
        Sequence<T> newSequence = new Sequence<>();

        if (originalSequence != null)
            for (T element : originalSequence.getElements()) {
                if (element != null && vocabCache.hasToken(element.getLabel())) {
                    newSequence.addElement(vocabCache.wordFor(element.getLabel()));
                }
            }

        newSequence.setSequenceId(originalSequence.getSequenceId());

        return newSequence;
    }