Interface PushPullTransformer<T>
- Type Parameters:
T
- type of items to be submitted
- All Known Implementing Classes:
Downsampler
,FractionalDownsampler
,GVCFBlockCombiner
,LevelingDownsampler
,MutectDownsampler
,PassThroughDownsampler
,PositionalDownsampler
,ReadsDownsampler
,ReblockingGVCFBlockCombiner
,ReservoirDownsampler
,SomaticGVCFBlockCombiner
public interface PushPullTransformer<T>
A class that receives a stream of elements and transforms or filters them in some way, such as by downsampling with
a
Downsampler
. Elements are submitted in a push-style model,
in contrast to Java's pull-style Iterator
. A transformer may be used to transform an iterator of
elements using PushToPullIterator
. In general, implementations should preserve the ordering of elements,
although this is not required.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturn (and *remove*) all items that have survived transformation and are waiting to be retrieved.boolean
Are there items that have survived the transformation process waiting to be retrieved?void
Used to tell the transformer that no more items will be submitted to it, and that it should finalize any pending items.default void
submit
(Collection<T> items) void
Submit one item to the transformer for consideration.
-
Method Details
-
submit
Submit one item to the transformer for consideration. Some transformers will be able to determine immediately whether the item survives the transformation process, while others will need to see more items before making that determination.- Parameters:
item
- the individual item to submit to the transformer for consideration
-
hasFinalizedItems
boolean hasFinalizedItems()Are there items that have survived the transformation process waiting to be retrieved?- Returns:
- true if this transformer has > 0 finalized items, otherwise false
-
consumeFinalizedItems
Return (and *remove*) all items that have survived transformation and are waiting to be retrieved.- Returns:
- a list of all finalized items this transformer contains, or an empty list if there are none
-
signalEndOfInput
void signalEndOfInput()Used to tell the transformer that no more items will be submitted to it, and that it should finalize any pending items. -
submit
-