Class ExecuteWhenDoneYielder<T>
- java.lang.Object
-
- org.apache.druid.java.util.common.guava.ExecuteWhenDoneYielder<T>
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Yielder<T>
public class ExecuteWhenDoneYielder<T> extends Object implements Yielder<T>
-
-
Constructor Summary
Constructors Constructor Description ExecuteWhenDoneYielder(Yielder<T> baseYielder, Runnable runnable, Executor executor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
T
get()
Gets the object currently held by this Yielder.boolean
isDone()
Returns true if this is the last Yielder in the chain.Yielder<T>
next(T initValue)
Gets the next Yielder in the chain.
-
-
-
Method Detail
-
get
public T get()
Description copied from interface:Yielder
Gets the object currently held by this Yielder. Can be called multiple times as long as next() is not called. Once next() is called on this Yielder object, all further operations on this object are undefined.
-
next
public Yielder<T> next(T initValue)
Description copied from interface:Yielder
Gets the next Yielder in the chain. The argument is used as the accumulator value to pass along to start the accumulation until the next yield() call or iteration completes. Once next() is called on this Yielder object, all further operations on this object are undefined.
-
isDone
public boolean isDone()
Description copied from interface:Yielder
Returns true if this is the last Yielder in the chain. Review the class level javadoc for an understanding of the contract for other methods when isDone() is true. Once next() is called on this Yielder object, all further operations on this object are undefined.
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
-