Package noaa.coastwatch.util.chunk
Interface ChunkFunction
- All Known Implementing Classes:
CompositeFunction
,CompositeMapApplicationFunction
,CompositeMapFunction
,ExpressionFunction
public interface ChunkFunction
The
ChunkFunction
interface is to be implemented by
any class that performs some type of processing on a set of input data
chunks to produce an output chunk. The function is many-to-one.
A chunk function must be thread-safe to be used in a multi-threaded
application.- Since:
- 3.4.0
- Author:
- Peter Hollemans
-
Method Summary
Modifier and TypeMethodDescriptionapply
(ChunkPosition pos, List<DataChunk> inputChunks) Applies some function to a list of chunks.default long
getMemory
(ChunkPosition pos, int chunks) Estimates the memory requirements for processing a chunk of data at the specified position, not including the input and output chunk internal data arrays.
-
Method Details
-
apply
Applies some function to a list of chunks.- Parameters:
pos
- the position to perform the function.inputChunks
- the list of chunks as input to the function.- Returns:
- the output chunk of the function, or null if no valid output chunk could be computed.
-
getMemory
Estimates the memory requirements for processing a chunk of data at the specified position, not including the input and output chunk internal data arrays.- Parameters:
pos
- the position to estimate the memory usage.chunks
- the number of input chunks that will be processed at once.- Returns:
- the memory in bytes.
- Throws:
UnsupportedOperationException
- if the memory calculation is not implemented by this function.- Since:
- 3.8.1
-