Package noaa.coastwatch.util.chunk
Class LongChunk
java.lang.Object
noaa.coastwatch.util.chunk.LongChunk
- All Implemented Interfaces:
DataChunk
,IntegerValuedDataChunk
The
LongChunk
class holds primitive long data with optional
packing scheme and missing values.- Since:
- 3.4.0
- Author:
- Peter Hollemans
-
Nested Class Summary
Nested classes/interfaces inherited from interface noaa.coastwatch.util.chunk.DataChunk
DataChunk.DataType
-
Constructor Summary
ConstructorDescriptionLongChunk
(long[] longData, boolean isUnsigned, Long missing, PackingScheme scheme) Creates a new initialized data chunk with scaling parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(ChunkVisitor visitor) Accepts a visitor in this chunk.Creates a blank copy of this data chunk.blankCopyWithValues
(int values) Creates a blank copy of this data chunk with the specified number of data values.Gets the external data type that values in this chunk are meant to represent.long[]
Gets the primitive array used to store data.Gets the missing value.Gets the packing scheme.Gets the primitive chunk data.int
Gets the number of values held by this chunk.boolean
isCompatible
(DataChunk chunk) Checks if this chunk is compatible with another.boolean
Gets the unsigned flag.
-
Constructor Details
-
LongChunk
Creates a new initialized data chunk with scaling parameters.- Parameters:
longData
- the long data values.isUnsigned
- the unsigned flag, true if the long data values are in the range [0..2^64-1] or false for [-2^63..2^63-1].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 interfaceIntegerValuedDataChunk
- Returns:
- true if the primitive data values are unsigned.
-
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 interfaceIntegerValuedDataChunk
- Returns:
- the packing scheme or null if the chunk data is not packed.
-
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 interfaceDataChunk
- Returns:
- the external data type.
-
accept
Description copied from interface:DataChunk
Accepts a visitor in this chunk. -
getValues
public int getValues()Description copied from interface:DataChunk
Gets the number of values held by this chunk. -
getPrimitiveData
Description copied from interface:DataChunk
Gets the primitive chunk data.- Specified by:
getPrimitiveData
in interfaceDataChunk
- Returns:
- the primitive data stored in this chunk.
-
blankCopy
Description copied from interface:DataChunk
Creates a blank copy of this data chunk. -
blankCopyWithValues
Description copied from interface:DataChunk
Creates a blank copy of this data chunk with the specified number of data values.- Specified by:
blankCopyWithValues
in interfaceDataChunk
- 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
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.
-
getLongData
public long[] getLongData()Gets the primitive array used to store data.- Returns:
- the primitive long data array containing the data.
-
isCompatible
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 interfaceDataChunk
- Parameters:
chunk
- the data chunk to check.
-