RxJava



rx.operators
Class ChunkedOperation.Chunks<T,C>

java.lang.Object
  extended by rx.operators.ChunkedOperation.Chunks<T,C>
Type Parameters:
T - The type of objects which the internal ChunkedOperation.Chunk objects record. The type of object being tracked by the ChunkedOperation.Chunk
Direct Known Subclasses:
ChunkedOperation.NonOverlappingChunks, ChunkedOperation.OverlappingChunks, ChunkedOperation.SizeBasedChunks, ChunkedOperation.TimeAndSizeBasedChunks
Enclosing class:
ChunkedOperation

protected static class ChunkedOperation.Chunks<T,C>
extends java.lang.Object

This class represents an object which contains and manages multiple ChunkedOperation.Chunk objects.


Constructor Summary
ChunkedOperation.Chunks(Observer<? super C> observer, Func0<? extends ChunkedOperation.Chunk<T,C>> chunkMaker)
          Constructs a new ChunkedOperation.Chunks object for the specified Observer.
 
Method Summary
 ChunkedOperation.Chunk<T,C> createChunk()
          This method will instantiate a new ChunkedOperation.Chunk object and register it internally.
 void emitAllChunks()
          This method emits all not yet emitted ChunkedOperation.Chunk objects.
 void emitChunk(ChunkedOperation.Chunk<T,C> chunk)
          This method emits the specified ChunkedOperation.Chunk object.
 ChunkedOperation.Chunk<T,C> getChunk()
           
 void pushValue(T value)
          This method pushes a value to all not yet emitted ChunkedOperation.Chunk objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChunkedOperation.Chunks

public ChunkedOperation.Chunks(Observer<? super C> observer,
                               Func0<? extends ChunkedOperation.Chunk<T,C>> chunkMaker)
Constructs a new ChunkedOperation.Chunks object for the specified Observer.

Parameters:
observer - The Observer to which this object will emit its internal ChunkedOperation.Chunk objects to when requested.
Method Detail

createChunk

public ChunkedOperation.Chunk<T,C> createChunk()
This method will instantiate a new ChunkedOperation.Chunk object and register it internally.

Returns:
The constructed empty ChunkedOperation.Chunk object.

emitAllChunks

public void emitAllChunks()
This method emits all not yet emitted ChunkedOperation.Chunk objects.


emitChunk

public void emitChunk(ChunkedOperation.Chunk<T,C> chunk)
This method emits the specified ChunkedOperation.Chunk object.

Parameters:
chunk - The ChunkedOperation.Chunk to emit.

getChunk

public ChunkedOperation.Chunk<T,C> getChunk()
Returns:
The oldest (in case there are multiple) ChunkedOperation.Chunk object.

pushValue

public void pushValue(T value)
This method pushes a value to all not yet emitted ChunkedOperation.Chunk objects.

Parameters:
value - The value to push to all not yet emitted ChunkedOperation.Chunk objects.