/*
(non-Javadoc)

@see jgrass.io.MapReader#hasMoreData() checks if there are more data and if there are not, it
stops
974942
public boolean hasMoreData( IHMProgressMonitor monitor ) throws Exception {
        try {
            if (dataWindow != null && moreData == true) {

                outputData = new double[dataWindow.getRows()][dataWindow.getCols()];

                /* Allocate the space for the map data. */
                int bufferSize = dataWindow.getRows() * dataWindow.getCols() * numberOfBytesPerValue;

                // System.out.println("retrieveing data in window: " +
                // dataWindow.toString());

                try {
                    /* Byte array that will hold a complete null row */
                    byte[] nullRow = null;
                    /* The rowDataArray holds the unpacked row data */
                    byte[] rowDataCache = new byte[dataWindow.getCols() * numberOfBytesPerValue];
                    /* The rowColorDataArray holds the unpacked row color data */
                    byte[] rowColorDataCache = new byte[dataWindow.getCols() * 4];
                    /* Reset row cache */
                    // rowCache = ByteBuffer.allocate(fileWindow.getCols() *
                    // ((rasterMapType == -2) ? 8 : 4));
                    // if (logger.isDebugEnabled())
                    // logger.debug("allocating rowDataArray["+rowDataArray.length+
                    // "], rowCache["+rowCache.limit()+"]");
                    rowCacheRow = -1;
                    firstDataRow = -1;
                    int rowindex = -1;
                    /* Get a local reference to speed things up */
                    int filerows = fileWindow.getRows();
                    double filenorth = fileWindow.getNorth();
                    double filensres = fileWindow.getNSResolution();
                    double datanorth = dataWindow.getNorth();
                    double datansres = dataWindow.getNSResolution();
                    // double datansres2 = datansres / 2;
                    /* Iterate through all the rows of the data window. */
                    // int lastpos = 0;
                    monitor.beginTask(GearsMessageHandler.getInstance().message("grass.legacy.reading") + filename, dataWindow //$NON-NLS-1$
                            .getRows());
                    int stepRowsForPercentage = dataWindow.getRows() / 100;
                    for( double row = 0; row < dataWindow.getRows(); row++ ) {
                        if (row % stepRowsForPercentage == 0.0)
                            monitor.worked(stepRowsForPercentage);
                        /*
                         * Calculate the map file row for the current data window row.
                         */
                        double filerow = (filenorth - (datanorth - (row * datansres))) / filensres;
                        filerow = Math.floor(filerow);
                        // int filerow = (int) ((filenorth - (datanorth - (row *
                        // datansres + datansres2))) / filensres);
                        // System.out.print("FILENORTH="+filenorth+",
                        // DATANORTH="+datanorth+", FILEROW="+row);
                        if (filerow < 0 || filerow >= filerows) {
                            // System.out.println(", NULL ROW");
                            /*
                             * If no data has been read yet, then increment first data row counter
                             */
                            if (firstDataRow == -1)
                                rowindex++;
                            /*
                             * Write a null row to the raster buffer. To speed things up the first
                             * time this is called it instantiates the buffer and fills it with null
                             * values that are reused the other times.
                             */
                            if (nullRow == null)
                                nullRow = initNullRow();
                            ByteBuffer wrap = ByteBuffer.wrap(nullRow);
                            for( int col = 0; col < dataWindow.getCols(); col++ ) {
                                outputData[(int) row][col] = wrap.getDouble();
                            }
                        } else {
                            // System.out.println(", DATA ROW");
                            if (firstDataRow == -1)
                                firstDataRow = rowindex + 1;
                            /* Read row and put in raster buffer */
                            if (filerow == rowCacheRow) {
                                ByteBuffer wrap = ByteBuffer.wrap(rowDataCache);
                                for( int col = 0; col < dataWindow.getCols(); col++ ) {
                                    outputData[(int) row][col] = wrap.getDouble();
                                }
                            } else {
                                readRasterRow((int) filerow, rowDataCache, rowColorDataCache);
                                rowCacheRow = (int) filerow;
                                ByteBuffer wrap = ByteBuffer.wrap(rowDataCache);
                                for( int col = 0; col < dataWindow.getCols(); col++ ) {
                                    outputData[(int) row][col] = wrap.getDouble();
                                }
                            }
                        }
                        // System.out.println("FILEROWS="+filerows+",
                        // FILEROW="+filerow+", ROWCACHEROW="+rowCacheRow+",
                        // ROW_COUNTER="+row);
                    }
                    monitor.done();

                    rowDataCache = null;
                    rowColorDataCache = null;
                    rowCacheRow = -1;
                    nullRow = null;
                    System.gc();
                } catch (IOException e) {
                    moreData = false;
                } catch (DataFormatException e) {
                    moreData = false;
                }
            }

        } catch (Exception e) {
            e.printStackTrace();
            throw new RasterReadingFailureException("Problems reading raster: " + e.getLocalizedMessage());

        }
        return moreData;
    }
599649
private void loadMoreData() {
        isLoading = true;
        Util.getClient()
                .getCloudItemsAsync(sourceId, currentPath, nextTokens.get(currentPath))
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(this);
    }
337278
public synchronized boolean hasMoreElementsR()
                    throws RemoteException, EnumeratorException
    {
        if (elements != null && index < elements.length) {
            return true;

        } else if (!exhausted) {

            // Reset our local cache and attempt to fetch the next batch
            // from the server

            try {
                elements = null;
                index = 0;
                elements = fetchElements(PREFETCH_COUNT);
                return true;
            } catch (NoMoreElementsException ex) {
                // We've exhausted the remote result set
                // FFDCFilter.processException(ex, CLASS_NAME + ".hasMoreElementsR",
                //                             "172", this);
                return false;
            }

        }

        // Exhausted!
        return false;

    }
1014644
private boolean next() throws IOException {
    if (valuesRead >= endOfPageValueCount) {
      if (valuesRead >= totalValueCount) {
        // How do we get here? Throw end of stream exception?
        return false;
      }
      readPage();
    }
    ++valuesRead;
    // TODO: Don't read for flat schemas
    //repetitionLevel = repetitionLevelColumn.nextInt();
    return definitionLevelColumn.nextInt() == maxDefLevel;
  }
598782
@Override
	public boolean hasNext()
	{
		try {
			if (result != null && result.next()) {
				return true;
			}

			// Close old queries
			if (this.statement != null) {
				this.statement.close();
			}
			if (this.result != null) {
				this.result.close();
			}

			if (primaryKey <= endPK) { // TODO: <= ?
				return query();
			}

			return false;

		}
		catch (SQLException e) {
			throw new RuntimeException(e);
		}
	}
226066
function readMore() {
    while (pos < input.length) {
      if (!utils.isJsonWhitespace(input[pos])) {
        return true;
      }
      pos++;
      parser.streamPos_++;
    }
    return false;
  }
1220270
@Override
  public boolean hasNext()
  {
    if (jp.isClosed()) {
      return false;
    }
    if (jp.getCurrentToken() == JsonToken.END_ARRAY) {
      CloseQuietly.close(jp);
      return false;
    }
    return true;
  }
387650
public boolean hasNext() {
		if(cachedNext != null) return true;
		while(itr.hasNext()) {
			S o = itr.next();
			T adapted = adapter.adapt(o);
			if(adapted != null) {
				cachedNext = adapted;
				return true;
			}
		}
		return false;
	}
894946
public HasData hasData() {
        boolean scalar = values.containsKey("");
        boolean vector = scalar ? getCount() > 1 : getCount() > 0;
        return scalar && vector ? HasData.BOTH : scalar ? HasData.SCALAR : vector ? HasData.VECTOR : HasData.NONE;
    }
1176669
@Override
    public boolean hasNext() {
        if (!members.hasNext()) {
            try {
                getNextEntries();
            } catch (final Exception ignored) {
                LOG.error("An error occured while getting next entries", ignored);
            }
        }
        return members.hasNext();
    }
578094
@Override
    public boolean hasNext()
    {
        if (fetchSize != 0 && (count % fetchSize) == 0)
        {
            try
            {
                results = populateEntities(entityMetadata, client);
                count = 0;
            }
            catch (Exception e)
            {
                throw new PersistenceException("Error while scrolling over results, Caused by :.", e);
            }
        }
        if (results != null && !results.isEmpty() && count < results.size())
        {
            return true;
        }

        return false;
    }
911620
boolean getMoreResults(int current) throws SQLException {
        checkClosed();

        if (resultIn == null || !resultIn.isData()) {
            return false;
        }

        if (resultSetCounter == 0) {
            resultSetCounter++;
            return true;
        }

        if (currentResultSet != null && current != KEEP_CURRENT_RESULT) {
            currentResultSet.close();
        }

        resultIn = null;

        return false;
    }
879205
private boolean loadMore(int available)
        throws IOException
    {
        mByteCount += (mByteBufferEnd - available);

        // Bytes that need to be moved to the beginning of buffer?
        if (available > 0) {
	    /* 11-Nov-2008, TSa: can only move if we own the buffer; otherwise
	     *   we are stuck with the data.
	     */
            if (mBytePtr > 0 && canModifyBuffer()) {
                for (int i = 0; i < available; ++i) {
                    mByteBuffer[i] = mByteBuffer[mBytePtr+i];
                }
                mBytePtr = 0;
		mByteBufferEnd = available;
            }
        } else {
            /* Ok; here we can actually reasonably expect an EOF,
             * so let's do a separate read right away:
             */
            int count = readBytes();
            if (count < 1) {
                if (count < 0) { // -1
                    freeBuffers(); // to help GC?
                    return false;
                }
                // 0 count is no good; let's err out
                reportStrangeStream();
            }
        }

        /* Need at least 4 bytes; if we don't get that many, it's an
         * error.
         */
        while (mByteBufferEnd < 4) {
            int count = readBytesAt(mByteBufferEnd);
            if (count < 1) {
                if (count < 0) { // -1, EOF... no good!
                    freeBuffers(); // to help GC?
                    reportUnexpectedEOF(mByteBufferEnd, 4);
                }
                // 0 count is no good; let's err out
                reportStrangeStream();
            }
        }
        return true;
    }
580682
@Override
	public boolean hasNext() {
		if (!isForward) {
			currentRec = currentRec - pointerSize;
			isForward = true;
		}
		return currentRec > 0 || blk.number() > 0;
	}
1272807
@Override
    public boolean hasMoreTokens() {
        log.info("Tokens size: [" + tokens.size() + "], position: [" + position.get() + "]");
        if (!tokens.isEmpty())
            return position.get() < tokens.size();
        else
            return streamHasMoreTokens();
    }
359265
private boolean loadMore(int available)
        throws IOException
    {
        mByteCount += (mByteBufferEnd - available);

        // Bytes that need to be moved to the beginning of buffer?
        if (available > 0) {
	    /* 11-Nov-2008, TSa: can only move if we own the buffer; otherwise
	     *   we are stuck with the data.
	     */
            if (mBytePtr > 0 && canModifyBuffer()) {
                for (int i = 0; i < available; ++i) {
                    mByteBuffer[i] = mByteBuffer[mBytePtr+i];
                }
                mBytePtr = 0;
		mByteBufferEnd = available;
            }
        } else {
            /* Ok; here we can actually reasonably expect an EOF,
             * so let's do a separate read right away:
             */
            int count = readBytes();
            if (count < 1) {
                if (count < 0) { // -1
                    freeBuffers(); // to help GC?
                    return false;
                }
                // 0 count is no good; let's err out
                reportStrangeStream();
            }
        }

        /* We now have at least one byte... and that allows us to
         * calculate exactly how many bytes we need!
         */
        @SuppressWarnings("cast")
        int c = (int) mByteBuffer[mBytePtr];
        if (c >= 0) { // single byte (ascii) char... cool, can return
            return true;
        }

        // Ok, a multi-byte char, let's check how many bytes we'll need:
        int needed;
        if ((c & 0xE0) == 0xC0) { // 2 bytes (0x0080 - 0x07FF)
            needed = 2;
        } else if ((c & 0xF0) == 0xE0) { // 3 bytes (0x0800 - 0xFFFF)
            needed = 3;
        } else if ((c & 0xF8) == 0xF0) {
            // 4 bytes; double-char BS, with surrogates and all...
            needed = 4;
        } else {
            reportInvalidInitial(c & 0xFF, 0);
            // never gets here... but compiler whines without this:
            needed = 1;
        }

        /* And then we'll just need to load up to that many bytes;
         * if an EOF is hit, that'll be an error. But we need not do
         * actual decoding here, just load enough bytes.
         */
        while ((mBytePtr + needed) > mByteBufferEnd) {
            int count = readBytesAt(mByteBufferEnd);
            if (count < 1) {
                if (count < 0) { // -1, EOF... no good!
                    freeBuffers();
                    reportUnexpectedEOF(mByteBufferEnd, needed);
                }
                // 0 count is no good; let's err out
                reportStrangeStream();
            }
        }
        return true;
    }
643096
public boolean hasNext() {
		if(cachedNext != null) {
			return true;
		}
		while(cachedNext == null) {
			if(br != null) {
				// attempt to read the next line from this:
				try {
					cachedNext = br.readLine();
					if(cachedNext == null) {
						br = null;
						// next loop:
					} else {
						return true;
					}
				} catch (IOException e) {
					e.printStackTrace();
					br = null;
				}
			} else {
				// do we have more blocks to use?
				if(blockItr.hasNext()) {
					try {
						br = blockItr.next().readBlock();
					} catch (IOException e) {
						throw new RuntimeIOException();
					}
				} else {
					return false;
				}
			}
		}
		
		return false;
	}