@return Sequential Infinite (until Queue is closed) Stream of data from
this Queue
336184
@Override
    public ReactiveSeq<T> stream() {
        listeningStreams.incrementAndGet(); //assumes all Streams that ever connected, remain connected
        return ReactiveSeq.fromStream(closingStream(this::get, new AlwaysContinue()));
    }
213123
public IntStream getAllOccurrencesAsRanges() {
        IntStream result = IntStream.empty();
        // with/or without end
        for (int i = start; i < end; i++) {
            // every i is one occurrence
            int token_position = tokenIndex.suffix_array[i];
            IntStream range = IntStream.range(token_position, token_position + length);
            result = IntStream.concat(result, range);
        }
        return result;
    }
456408
public String getNextString()
    {
        Object data = this.getNextData();
        if (data instanceof String)
            return (String)data;
        return null;    // EOF
    }
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);
                    }
                });
    }
1189459
@Override
    public CompletableFuture<List<Map.Entry<UUID, Long>>> getNext() {
        return this.indexIterator
                .getNext()
                .thenApply(this::mix);
    }
247810
public int queueSize() {
        return queue.stream().map(el -> el.size).reduce(0, (l,r) -> l+r);
    }
878774
public Stream<T> lazyStream() throws IllegalStateException {

        if (pagerStream == null) {
            synchronized (this) {
                if (pagerStream == null) {

                    // Make sure that current page is 0, this will ensure the whole list is streamed
                    // regardless of what page the instance is currently on.
                    currentPage = 0;

                    pagerStream = StreamSupport.stream(new PagerSpliterator<T>(this), false);
                    return (pagerStream);
                }
            }
        }

        throw new IllegalStateException("Stream already issued");
    }
1338415
public Stream<? extends TrieNode> getChildren() {
    if (getData().firstChildIndex >= 0) {
      return IntStream.range(0, getData().numberOfChildren)
        .mapToObj(i -> new TrieNode(this.trie, getData().firstChildIndex + i, TrieNode.this));
    }
    else {
      return Stream.empty();
    }
  }
717384
@Override
    public Iterator<Path> iterator() {
        if (closed) {
            throw new IllegalStateException("Directory Stream is closed");
        } else if (iteratorReturned) {
            throw new IllegalStateException("Iterator was already returned");
        }

        boolean finishedSuccessfully = true;
        try {
            // Translate ShrinkWrap API to NIO.2 API Path
            final Map<ArchivePath, Node> content = this.fs.getArchive().getContent();
            final Collection<Path> newPaths = new ArrayList<>(content.size());
            final Collection<ArchivePath> archivePaths = content.keySet();
            for (final ArchivePath path : archivePaths) {
                final Path newPath = new ShrinkWrapPath(path, fs);

                if (!newPath.getParent().equals(startingPath)) {
                    continue;
                }

                // If we have a filter, and it rejects this path
                try {
                    if (filter != null && !(filter.accept(newPath))) {
                        // Move along
                        continue;
                    }
                } catch (IOException ioe) {
                    throw new RuntimeException("Error encountered during filtering", ioe);
                }

                // Add the new Path; the filter either wasn't specified or didn't reject this Path
                newPaths.add(newPath);
            }

            // Return
            return newPaths.iterator();
        } catch (Throwable t) {
            finishedSuccessfully = false;
            throw t;
        } finally {
            if (finishedSuccessfully) {
                iteratorReturned = true;
            }
        }
    }
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;
  }
194505
public IPromise<String> getDataSimple() {
        Promise result = new Promise();
        result.complete("Data", null);
        return result;
    }
823616
public Object next()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "next");
    
    Long ticks;  
    RemoteMessageRequest remoteMessageRequest;
    if (msgIterator.hasNext())
    {
      ticks =  (Long) msgIterator.next();
      
      remoteMessageRequest = new RemoteMessageRequest(ticks.longValue(), aiStream);
    }
    else
    {
    	remoteMessageRequest = null;
    }
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "next", remoteMessageRequest);
      
    return remoteMessageRequest;      
  }
274306
public Object next()
	{
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
    {
      SibTr.entry(tc, "next");
    } 
    
    Object result;
		if (msgIterator.hasNext())
		{
      Long valueStamp = (Long) msgIterator.next();
      
			result = new TransmitMessageRequest(valueStamp.longValue(), aoStream.itemStream, aoStream, messageProcessor, aoh.getDestinationHandler());
		}
		else
		{
			result = null;
		}
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
    {
      SibTr.exit(tc, "next", result);
    } 
    return result;
	}
862781
public Object next()
  {
    if (tc.isEntryEnabled())
    {
      SibTr.entry(tc, "next");
    } 
    
    Object result;
    if (hasNext())
    {
      AnycastInputHandler aih = (AnycastInputHandler) anycastIHIterator.next();
      
      result = aih.getControlAdapter();
    }
    else
    {
      result = null;
    }
    
    if (tc.isEntryEnabled())
    {
      SibTr.exit(tc, "next", result);
    } 
    return result;
  }
1227611
private int nextByte() throws IOException {
        int result = 0;
        if (!endOfStream) {
            result = read();
            if (result == -1) {
                endOfStream = true;
            }
        }
        return endOfStream ? 0 : result;
    }
76063
public JsonElement next() throws JsonParseException {
    if (!hasNext()) {
      throw new NoSuchElementException();
    }
    
    try {
      return Streams.parse(parser);
    } catch (StackOverflowError e) {
      throw new JsonParseException("Failed parsing JSON source to Json", e);
    } catch (OutOfMemoryError e) {
      throw new JsonParseException("Failed parsing JSON source to Json", e);
    } catch (JsonParseException e) {
      throw e.getCause() instanceof EOFException ? new NoSuchElementException() : e;
    }
  }
278774
public S getEmptySequence() {
        if (empty == null)
            synchronized (this) {
                if (empty == null)
                    empty = createBuilder().createAndDestroy();
            }
        return empty;
    }