/*
(non-Javadoc)

@see jgrass.io.MapReader#getNextData() returns the data in the required format
320752
public Object getNextData() {
        moreData = false;
        if (dataObject instanceof double[][]) {
            return outputData;
        } else {
            throw new RuntimeException();
        }
    }

    public ColorMapBuffer getNextDataColor( int attColor ) {
        return null;
    }

    /**
     * Create a string that defines how the legend will look.
     * @throws IOException 
     */
    public String getLegendString() throws IOException {
        return null;
    }

    /**
     * 
     */
    public void hasChanged( boolean _haschanged ) {
        // if (_haschanged) {
        // novalue = new Double(Double.NaN);
        // matrixType = 0;
        // // theFilePath = null;
        // cellFile = nullFile = null;
        // filename = null;
        // mapsetPath = null;
        // locationPath = null;
        // rasterByteBuffer = null;
        // moreData = false;
        // // fileWindow = null;
        // // dataWindow = null;
        // rasterMapType = -9999;
        // numberOfBytesPerValue = -9999;
        // compressed = -9999;
        // }
        // hasChanged = _haschanged;
    }
804086
public String next() {
        if (!hasNext()) {
            throw new NoSuchElementException();
        }

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

        return next;
    }
458429
private int readNext(byte[] dest, int offset, int len)
            throws IOException
    {
        int readBytes = 0;
        while (readBytes < len) {
            int ret = in.read(dest, readBytes + offset, len - readBytes);
            if (ret == -1) {
                finishedReading = true;
                return readBytes;
            }
            readBytes += ret;
        }
        return readBytes;
    }
911367
@Override
    protected Content getNavLinkNext() {
        if (next == null) {
            return getNavLinkNext(null);
        } else {
            DocPath path = DocPath.relativePath(packageElement, next);
            return getNavLinkNext(path.resolve(DocPaths.PACKAGE_TREE));
        }
    }
1055085
public Content getNavLinkNext() {
        Content li;
        if (nextProfile == null) {
            li = HtmlTree.LI(nextprofileLabel);
        } else {
            li = HtmlTree.LI(getHyperLink(pathToRoot.resolve(DocPaths.profileSummary(
                    nextProfile.name)), nextprofileLabel, "", ""));
        }
        return li;
    }
1098106
@Override
    protected Path findNext(){
        E elem = delegate.next();
        return elem==null ? null : path.append(elem, index()+1);
    }
428965
public int getNextCode() {
        // Attempt to get the next code. The exception is caught to make
        // this robust to cases wherein the EndOfInformation code has been
        // omitted from a strip. Examples of such cases have been observed
        // in practice.
        try {
            nextData = (nextData << 8) | (data[bytePointer++] & 0xff);
            nextBits += 8;
            
            if (nextBits < bitsToGet) {
                nextData = (nextData << 8) | (data[bytePointer++] & 0xff);
                nextBits += 8;
            }
            
            int code =
            (nextData >> (nextBits - bitsToGet)) & andTable[bitsToGet-9];
            nextBits -= bitsToGet;
            
            return code;
        } catch(ArrayIndexOutOfBoundsException e) {
            // Strip not terminated as expected: return EndOfInformation code.
            return 257;
        }
    }
1148994
private char readNext() throws IOException {
        if (cachedNext != null) {
            char next = cachedNext.charValue();
            cachedNext = null;
            return next;
        }
        int next = input.read();
        if (next == -1) {
            throw new IllegalArgumentException("Invalid JSON data: End of file");
        }
        return (char) next;
    }
109058
synchronized long getNextIndex(String server) {
        checkState(role == Role.LEADER, "role:%s", role);
        checkState(self.equals(leader), "self:%s leader:%s", self, leader);
        checkState(serverData.containsKey(server), "server:%s", server);

        return serverData.get(server).nextIndex;
    }
87430
@Override
    public DataSet next() {
        DataSet next = iter.next();
        next.setLabels(next.getFeatures());
        return next;
    }
542941
@Override
    public DurableDataLog.ReadItem getNext() throws DurableDataLogException {
        Exceptions.checkNotClosed(this.closed.get(), this);

        if (this.currentLedger == null) {
            // First time we call this. Locate the first ledger based on the metadata truncation address. We don't know
            // how many entries are in that first ledger, so open it anyway so we can figure out.
            openNextLedger(this.metadata.getNextAddress(this.metadata.getTruncationAddress(), Long.MAX_VALUE));
        }

        while (this.currentLedger != null && (!this.currentLedger.canRead())) {
            // We have reached the end of the current ledger. Find next one, and skip over empty ledgers).
            val lastAddress = new LedgerAddress(this.currentLedger.metadata, this.currentLedger.handle.getLastAddConfirmed());
            Ledgers.close(this.currentLedger.handle);
            openNextLedger(this.metadata.getNextAddress(lastAddress, this.currentLedger.handle.getLastAddConfirmed()));
        }

        // Try to read from the current reader.
        if (this.currentLedger == null || this.currentLedger.reader == null) {
            return null;
        }

        return new LogReader.ReadItem(this.currentLedger.reader.nextElement(), this.currentLedger.metadata);
    }
724098
public Packet getNextPacket() {
        Packet parsedPacket = parseNextPacketFromPdml();
        
        if ( parsedPacket == null ) {       // All packets have been read
            return null;
        }
        
        parsedPacket = addTcpdumpInfoToPacket(parsedPacket);
        
        return parsedPacket;
    }
1348972
@Override
    public CompletableFuture<T> getNext() {
        // Verify no other call to getNext() is currently executing.
        return getNextBucket()
                .thenCompose(bucket -> {
                    if (bucket == null) {
                        // We are done.
                        return CompletableFuture.completedFuture(null);
                    } else {
                        // Convert the TableBucket into the desired result.
                        return this.resultConverter.apply(bucket);
                    }
                });
    }
405511
@SuppressWarnings("unchecked")
  @Override
  protected T getNext() {
    T token = null;
    if (lexer == null) {
      return token;
    }
    try {
      token = (T) lexer.next();
      while (token != null && token.word().equals(WhitespaceLexer.NEWLINE)) {
        if (eolIsSignificant) {
          return token;
        } else {
          token = (T) lexer.next();
        }
      }
    } catch (IOException e) {
      // do nothing, return null
    }
    return token;
  }
726942
public String getNextLine() {
		if (!isNextLine()) {
			return null;
		}
		if (isTag(nextLine))
			return FlatFileUtils.trimRight(nextLine,
					getTagWidth(nextLine));
		else
			return nextLine.trim();
	}
194147
public InputFile getNextFile() {
    for (Iterator<String> iter = queuedNames.iterator(); iter.hasNext(); ) {
      String name = iter.next();
      iter.remove();
      processedNames.add(name);
      InputFile file = getFileForName(name);
      if (file != null) {
        return file;
      }
    }
    return null;
  }
508843
@Override
    public Content getNavLinkNext() {
        Content nextletterLabel = contents.nextLetter;
        if (next == -1) {
            return HtmlTree.LI(nextletterLabel);
        }
        else {
            Content nextLink = getHyperLink(DocPaths.indexN(next),
                    nextletterLabel);
            return HtmlTree.LI(nextLink);
        }
    }