Class ChunkDataModifier

java.lang.Object
noaa.coastwatch.util.chunk.ChunkDataModifier
All Implemented Interfaces:
ChunkVisitor

public class ChunkDataModifier extends Object implements 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 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

      public void visitByteChunk(ByteChunk chunk)
      Description copied from interface: ChunkVisitor
      Visits a chunk of native byte data.
      Specified by:
      visitByteChunk in interface ChunkVisitor
      Parameters:
      chunk - the byte chunk to visit.
    • visitShortChunk

      public void visitShortChunk(ShortChunk chunk)
      Description copied from interface: ChunkVisitor
      Visits a chunk of native short data.
      Specified by:
      visitShortChunk in interface ChunkVisitor
      Parameters:
      chunk - the short chunk to visit.
    • visitIntChunk

      public void visitIntChunk(IntChunk chunk)
      Description copied from interface: ChunkVisitor
      Visits a chunk of native int data.
      Specified by:
      visitIntChunk in interface ChunkVisitor
      Parameters:
      chunk - the int chunk to visit.
    • visitLongChunk

      public void visitLongChunk(LongChunk chunk)
      Description copied from interface: ChunkVisitor
      Visits a chunk of native long data.
      Specified by:
      visitLongChunk in interface ChunkVisitor
      Parameters:
      chunk - the long chunk to visit.
    • visitFloatChunk

      public void visitFloatChunk(FloatChunk chunk)
      Description copied from interface: ChunkVisitor
      Visits a chunk of native float data.
      Specified by:
      visitFloatChunk in interface ChunkVisitor
      Parameters:
      chunk - the float chunk to visit.
    • visitDoubleChunk

      public void visitDoubleChunk(DoubleChunk chunk)
      Description copied from interface: ChunkVisitor
      Visits a chunk of native double data.
      Specified by:
      visitDoubleChunk in interface ChunkVisitor
      Parameters:
      chunk - the double chunk to visit.
    • main

      public static void main(String[] argv) throws Exception
      Tests this class.
      Parameters:
      argv - the array of command line parameters.
      Throws:
      Exception
      Since:
      3.6.1