Package noaa.coastwatch.util.chunk
Class ChunkDataAccessor
java.lang.Object
noaa.coastwatch.util.chunk.ChunkDataAccessor
- All Implemented Interfaces:
ChunkVisitor
The ChunkDataAccessor
class is a visitor that makes (possibly
unpacked) data values available from any type of DataChunk
instance.
The type of data available after the visitor is accepted by a chunk
can be determined from the DataChunk.getExternalType()
method.
The family of methods for accessing chunk data values in this
class takes the form getXXXValue(int)
where
XXX
is one of either Byte, Short, Int, Long, Float,
or Double. The isMissingValue(int)
method is used to determine if a
data value at a given index is invalid or missing, for any integer and
floating-point data.
- Since:
- 3.4.0
- Author:
- Peter Hollemans
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbyte
getByteValue
(int index) double
getDoubleValue
(int index) float
getFloatValue
(int index) int
getIntValue
(int index) long
getLongValue
(int index) short
getShortValue
(int index) boolean
isMissingValue
(int index) static void
Tests this class.void
setMissingMode
(boolean flag) Sets the missing mode flag.void
visitByteChunk
(ByteChunk chunk) Visits a chunk of native byte data.void
visitDoubleChunk
(DoubleChunk chunk) Visits a chunk of native double data.void
visitFloatChunk
(FloatChunk chunk) Visits a chunk of native float data.void
visitIntChunk
(IntChunk chunk) Visits a chunk of native int data.void
visitLongChunk
(LongChunk chunk) Visits a chunk of native long data.void
visitShortChunk
(ShortChunk chunk) Visits a chunk of native short data.
-
Constructor Details
-
ChunkDataAccessor
public ChunkDataAccessor()
-
-
Method Details
-
setMissingMode
public void setMissingMode(boolean flag) Sets the missing mode flag. In missing mode, only the missing array values are computed and stored by the accessor. This saves access time and memory. By default the missing mode is off and all data values are extracted as well.- Parameters:
flag
- the mimssing mode flag.- Since:
- 3.8.1
-
visitByteChunk
Description copied from interface:ChunkVisitor
Visits a chunk of native byte data.- Specified by:
visitByteChunk
in interfaceChunkVisitor
- Parameters:
chunk
- the byte chunk to visit.
-
visitShortChunk
Description copied from interface:ChunkVisitor
Visits a chunk of native short data.- Specified by:
visitShortChunk
in interfaceChunkVisitor
- Parameters:
chunk
- the short chunk to visit.
-
visitIntChunk
Description copied from interface:ChunkVisitor
Visits a chunk of native int data.- Specified by:
visitIntChunk
in interfaceChunkVisitor
- Parameters:
chunk
- the int chunk to visit.
-
visitLongChunk
Description copied from interface:ChunkVisitor
Visits a chunk of native long data.- Specified by:
visitLongChunk
in interfaceChunkVisitor
- Parameters:
chunk
- the long chunk to visit.
-
visitFloatChunk
Description copied from interface:ChunkVisitor
Visits a chunk of native float data.- Specified by:
visitFloatChunk
in interfaceChunkVisitor
- Parameters:
chunk
- the float chunk to visit.
-
visitDoubleChunk
Description copied from interface:ChunkVisitor
Visits a chunk of native double data.- Specified by:
visitDoubleChunk
in interfaceChunkVisitor
- Parameters:
chunk
- the double chunk to visit.
-
isMissingValue
public boolean isMissingValue(int index) -
getByteValue
public byte getByteValue(int index) -
getShortValue
public short getShortValue(int index) -
getIntValue
public int getIntValue(int index) -
getLongValue
public long getLongValue(int index) -
getFloatValue
public float getFloatValue(int index) -
getDoubleValue
public double getDoubleValue(int index) -
main
Tests this class.- Parameters:
argv
- the array of command line parameters.- Throws:
Exception
- Since:
- 3.6.1
-