Package noaa.coastwatch.util.chunk
Interface DataChunk
- All Known Subinterfaces:
FloatingPointValuedDataChunk
,IntegerValuedDataChunk
- All Known Implementing Classes:
ByteChunk
,DoubleChunk
,FloatChunk
,IntChunk
,LongChunk
,ShortChunk
public interface DataChunk
The
DataChunk
interface is implemented by concrete classes that
hold data of a specific internal primitive type. The internal type may be
different from the external type that the data values represent.- Since:
- 3.4.0
- Author:
- Peter Hollemans
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
The enumeration of the possible chunk external data types. -
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.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.int
Gets the number of bytes each value uses.
-
Method Details
-
getExternalType
DataChunk.DataType getExternalType()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.- Returns:
- the external data type.
-
accept
Accepts a visitor in this chunk.- Parameters:
visitor
- the visitor to accept.
-
getValues
int getValues()Gets the number of values held by this chunk.- Returns:
- the number of values.
-
getPrimitiveData
Object getPrimitiveData()Gets the primitive chunk data.- Returns:
- the primitive data stored in this chunk.
-
blankCopy
DataChunk blankCopy()Creates a blank copy of this data chunk.- Returns:
- the new blank data chunk. The data values are uninitialized.
-
blankCopyWithValues
Creates a blank copy of this data chunk with the specified number of data values.- Parameters:
values
- the number of data values in the new blank data chunk.- Returns:
- the new blank data chunk. The data values are uninitialized.
-
isCompatible
Checks if this chunk is compatible with another. Compatible chunks share the same primitive data type and other properties.- Parameters:
chunk
- the data chunk to check.- Since:
- 3.8.0
-
valueBytes
int valueBytes()Gets the number of bytes each value uses.- Returns:
- the bytes per data value in the primitive data.
- Since:
- 3.8.1
- See Also:
-