Class DataChunkFactory

java.lang.Object
noaa.coastwatch.util.chunk.DataChunkFactory

public class DataChunkFactory extends Object
The DataChunkFactory class create appropriate instances of the DataChunk class using a primitive data array.
Since:
3.4.0
Author:
Peter Hollemans
  • Method Details

    • getInstance

      public static DataChunkFactory getInstance()
      Gets the singleton instance of this class.
    • create

      public DataChunk create(Object data, boolean isUnsigned, Object missingValue, PackingScheme packing)
      Creates a new initialized data chunk.
      Parameters:
      data - the primitive array of data values to be used in the chunk.
      isUnsigned - the flag to indicate if the integer primitive values are actually unsigned values packed into a signed primitive (eg: byte value in the range [0..255] packaged as a signed byte in the range [-128..127]).
      missingValue - the missing value used as a marker for invalid data, or null for none.
      packing - the packing scheme for floating point data values packed as integer values in the chunk, or null for none.
      Returns:
      the data chunk wrapping the primitive array.
    • create

      public <T extends Number> DataChunk create(Class<T> primitiveType, int values, boolean isUnsigned, Object missingValue, PackingScheme packing, ScalingScheme scaling)
      Creates a new uninitialized data chunk.
      Parameters:
      primitiveType - the primitive data type for the chunk.
      values - the number of values in the data chunk.
      isUnsigned - the flag to indicate if the integer primitive values are actually unsigned values packed into a signed primitive (eg: byte value in the range [0..255] packaged as a signed byte in the range [-128..127]).
      missingValue - the missing value used as a marker for invalid data, or null for none.
      packing - the packing scheme for floating point data values packed as integer values in the chunk, or null for none.
      scaling - the scaling scheme for floating point data values or null for none. Either packing or scaling may be specified but not both.
      Returns:
      the data chunk wrapping the primitive array.
      Since:
      3.6.1
    • create

      public DataChunk create(Object data, boolean isUnsigned, Object missingValue, PackingScheme packing, ScalingScheme scaling)
      Creates a new initialized data chunk.
      Parameters:
      data - the primitive array of data values to be used in the chunk.
      isUnsigned - the flag to indicate if the integer primitive values are actually unsigned values packed into a signed primitive (eg: byte value in the range [0..255] packaged as a signed byte in the range [-128..127]).
      missingValue - the missing value used as a marker for invalid data, or null for none.
      packing - the packing scheme for floating point data values packed as integer values in the chunk, or null for none.
      scaling - the scaling scheme for floating point data values or null for none. Either packing or scaling may be specified but not both.
      Returns:
      the data chunk wrapping the primitive array.
      Since:
      3.6.1