Package noaa.coastwatch.util.chunk
Class ChunkDataModifier
java.lang.Object
noaa.coastwatch.util.chunk.ChunkDataModifier
- All Implemented Interfaces:
ChunkVisitor
The
ChunkDataModifier
class is a visitor that modifies
data values in any type of DataChunk
instance. The family of methods
in this class for specifying the source primitive data to use takes the
form setXXXData(xxx[])
where XXX
is one of
either Byte, Short, Int, Long, Float, or Double and xxx
is
byte, short, int, float, or double. If the source primitive data is
integer-valued (byte, short, int, long) and certain values should be marked
as missing in the chunk data, the setMissingData(boolean[])
method should be
used to mark which values are missing. In the case of float and double
primitive data, the values are checked for NaN values and those
values marked as missing in the chunk. No such standard sentinel
values exist for integer-valued data, so missing data must be marked as
missing separately from the data itself.- Since:
- 3.4.0
- Author:
- Peter Hollemans
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Tests this class.void
setByteData
(byte[] byteArray) void
setDoubleData
(double[] doubleArray) void
setFloatData
(float[] floatArray) void
setIntData
(int[] intArray) void
setLongData
(long[] longArray) void
setMissingData
(boolean[] isMissingArray) void
setShortData
(short[] shortArray) 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
-
ChunkDataModifier
public ChunkDataModifier()
-
-
Method Details
-
setMissingData
public void setMissingData(boolean[] isMissingArray) -
setByteData
public void setByteData(byte[] byteArray) -
setShortData
public void setShortData(short[] shortArray) -
setIntData
public void setIntData(int[] intArray) -
setLongData
public void setLongData(long[] longArray) -
setFloatData
public void setFloatData(float[] floatArray) -
setDoubleData
public void setDoubleData(double[] doubleArray) -
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.
-
main
Tests this class.- Parameters:
argv
- the array of command line parameters.- Throws:
Exception
- Since:
- 3.6.1
-