Gatherer.Downstream

public static interface Gatherer.Downstream

java.util.stream.Gatherer.Downstream<T>


A Downstream object is the next stage in a pipeline of operations, to which elements can be sent.

Summary

Public methods

default boolean isRejecting()

Checks whether the next stage is known to not want any more elements sent to it.

abstract boolean push(T element)

Pushes, if possible, the provided element downstream -- to the next stage in the pipeline.

Public methods

isRejecting

public boolean isRejecting ()

Checks whether the next stage is known to not want any more elements sent to it.

API Note:
  • This is best-effort only, once this returns true it should never return false again for the same instance.
Implementation Requirements:
  • The implementation in this interface returns false.
Returns
boolean true if this Downstream is known not to want any more elements sent to it, false if otherwise

push

public abstract boolean push (T element)

Pushes, if possible, the provided element downstream -- to the next stage in the pipeline.

Implementation Requirements:
  • If this method returns false then no further elements will be accepted and subsequent invocations of this method will return false.
Parameters
element T: the element to push downstream

Returns
boolean true if more elements can be sent, and false if not.