public class ChunkComputation extends java.lang.Object implements ChunkOperation
ChunkComputation
class can be used to perform a computation
on a set of input data chunks using a function and a list of chunk
producers/consumers. The computation is an operation broken down into a
set of calls to the perform(noaa.coastwatch.util.chunk.ChunkPosition)
method that performs the computation
on each chunk position. To help with testing, the computation can optionally
track the time used by chunk collecting, processing, and consuming.Constructor and Description |
---|
ChunkComputation(ChunkCollector collector,
ChunkConsumer consumer,
ChunkFunction function)
Creates a new chunk computation from the specified components.
|
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.lang.Double> |
getTrackingData()
Gets the time tracking data for the computation.
|
void |
perform(ChunkPosition pos)
Performs an operation on the chunks at the specified position.
|
void |
setIsTracked(boolean isTracked)
Sets the tracking flag for this computation.
|
public ChunkComputation(ChunkCollector collector, ChunkConsumer consumer, ChunkFunction function)
collector
- the collector to use for source data.consumer
- the consumer to push processed data to.function
- the function to use for processing the source chunk data.public void setIsTracked(boolean isTracked)
isTracked
- the tracking flag, true to track the chunk computation
and collector/consumer times or false to not. By default the
computation timing is not tracked.public java.util.Map<java.lang.String,java.lang.Double> getTrackingData()
public void perform(ChunkPosition pos)
ChunkOperation
perform
in interface ChunkOperation
pos
- the chunk position to act on.