Class IntChunk

java.lang.Object
noaa.coastwatch.util.chunk.IntChunk
All Implemented Interfaces:
DataChunk, IntegerValuedDataChunk

public class IntChunk extends Object implements IntegerValuedDataChunk
The IntChunk class holds primitive int data with optional packing scheme and missing values.
Since:
3.4.0
Author:
Peter Hollemans
  • Constructor Details

    • IntChunk

      public IntChunk(int[] intData, boolean isUnsigned, Integer missing, PackingScheme scheme)
      Creates a new initialized data chunk with scaling parameters.
      Parameters:
      intData - the int data values.
      isUnsigned - the unsigned flag, true if the int data values are in the range [0..4294967295] or false for [-2147483648..2147483647].
      missing - the missing data value, or null for none.
      scheme - the packing scheme, or null for no packing.
  • Method Details

    • isUnsigned

      public boolean isUnsigned()
      Description copied from interface: IntegerValuedDataChunk
      Gets the unsigned flag.
      Specified by:
      isUnsigned in interface IntegerValuedDataChunk
      Returns:
      true if the primitive data values are unsigned.
    • getPackingScheme

      public PackingScheme getPackingScheme()
      Description copied from interface: IntegerValuedDataChunk
      Gets the packing scheme. A packing scheme is used to reduce the size of floating point data to store in an integer value.
      Specified by:
      getPackingScheme in interface IntegerValuedDataChunk
      Returns:
      the packing scheme or null if the chunk data is not packed.
    • getExternalType

      public DataChunk.DataType getExternalType()
      Description copied from interface: DataChunk
      Gets the external data type that values in this chunk are meant to represent. This is the type that the chunk unpacks to if values are packed.
      Specified by:
      getExternalType in interface DataChunk
      Returns:
      the external data type.
    • accept

      public void accept(ChunkVisitor visitor)
      Description copied from interface: DataChunk
      Accepts a visitor in this chunk.
      Specified by:
      accept in interface DataChunk
      Parameters:
      visitor - the visitor to accept.
    • getValues

      public int getValues()
      Description copied from interface: DataChunk
      Gets the number of values held by this chunk.
      Specified by:
      getValues in interface DataChunk
      Returns:
      the number of values.
    • getPrimitiveData

      public Object getPrimitiveData()
      Description copied from interface: DataChunk
      Gets the primitive chunk data.
      Specified by:
      getPrimitiveData in interface DataChunk
      Returns:
      the primitive data stored in this chunk.
    • blankCopy

      public DataChunk blankCopy()
      Description copied from interface: DataChunk
      Creates a blank copy of this data chunk.
      Specified by:
      blankCopy in interface DataChunk
      Returns:
      the new blank data chunk. The data values are uninitialized.
    • blankCopyWithValues

      public DataChunk blankCopyWithValues(int values)
      Description copied from interface: DataChunk
      Creates a blank copy of this data chunk with the specified number of data values.
      Specified by:
      blankCopyWithValues in interface DataChunk
      Parameters:
      values - the number of data values in the new blank data chunk.
      Returns:
      the new blank data chunk. The data values are uninitialized.
    • getMissing

      public Integer getMissing()
      Gets the missing value. The missing value is used in the primitive data to represent invalid data values.
      Returns:
      the missing value or null if the chunk has no missing value specified.
    • getIntData

      public int[] getIntData()
      Gets the primitive array used to store data.
      Returns:
      the primitive int data array containing the data.
    • isCompatible

      public boolean isCompatible(DataChunk chunk)
      Description copied from interface: DataChunk
      Checks if this chunk is compatible with another. Compatible chunks share the same primitive data type and other properties.
      Specified by:
      isCompatible in interface DataChunk
      Parameters:
      chunk - the data chunk to check.
    • valueBytes

      public int valueBytes()
      Description copied from interface: DataChunk
      Gets the number of bytes each value uses.
      Specified by:
      valueBytes in interface DataChunk
      Returns:
      the bytes per data value in the primitive data.
      See Also: