public abstract class GvrsElement extends Object
This abstract class serves as the base for a set of derived classes that are associated with each GVRS data type (Integer, Float, Short, and Integer-coded Float).
Modifier and Type | Method and Description |
---|---|
GvrsElementType |
getDataType()
Get the data type associated with this element.
|
String |
getDescription()
Gets the arbitrary description string.
|
String |
getLabel()
Gets the arbitrary label string.
|
String |
getName()
Gets the name associated with the element.
|
String |
getUnitOfMeasure()
Gets the arbitrary unit of measure string.
|
boolean |
isContinuous()
Indicates whether the data element can be treated as a continuous
function over a surface or behaves in a non-continuous (discrete-valued)
manner.
|
float[] |
readBlock(int row,
int column,
int nRows,
int nColumns)
Reads a block (sub-grid) of floating-point values from the GVRS file based
on the grid row, column, and block-size specifications.
|
int[] |
readBlockInt(int row,
int column,
int nRows,
int nColumns)
Reads a block (sub-grid) of integer values from the GVRS file based
on the grid row, column, and block-size specifications.
|
abstract float |
readValue(GridPoint gridPoint)
Reads a floating-point value from the GVRS raster file.
|
abstract float |
readValue(int row,
int column)
Reads a floating-point value from the GVRS raster file.
|
abstract int |
readValueInt(GridPoint gridPoint)
Reads an integer value from the GVRS raster file.
|
abstract int |
readValueInt(int row,
int column)
Read an integer value from the GvrsFile.
|
String |
toString() |
abstract void |
writeValue(GridPoint gridPoint,
float value)
Write a floating-point value to the GVRS raster file.
|
abstract void |
writeValue(int row,
int col,
float value)
Write a floating-point value to the GVRS raster file.
|
abstract void |
writeValueInt(GridPoint gridPoint,
int value)
Write an integer value in the GVRS raster file.
|
abstract void |
writeValueInt(int row,
int column,
int value)
Write an integer value in the GVRS raster file.
|
public String getName()
public GvrsElementType getDataType()
public String getDescription()
public String getLabel()
public String getUnitOfMeasure()
public abstract int readValueInt(int row, int column) throws IOException
row
- a positive value in the range defined by the file
specifications.column
- a positive value in the range defined by the file
specifications.IOException
- in the event of a non-recoverable I/O exception.public abstract int readValueInt(GridPoint gridPoint) throws IOException
gridPoint
- a valid instanceIOException
- in the event of a non-recoverable I/O exception.public abstract void writeValueInt(int row, int column, int value) throws IOException
The value GvrsFileConstants.NULL_DATA_CODE is reserved for the representation of null data.
row
- a positive value in the range defined by the file
specifications.column
- a positive value in the range defined by the file
specifications.value
- an integer value.IOException
- in the event of an unrecoverable I/O exception.public abstract void writeValueInt(GridPoint gridPoint, int value) throws IOException
The value GvrsFileConstants.NULL_DATA_CODE is reserved for the representation of null data.
gridPoint
- a valid instance giving coordinates within the dimensions
of the grid.value
- an integer value.IOException
- in the event of an unrecoverable I/O exception.public abstract float readValue(int row, int column) throws IOException
row
- a positive value in the range defined by the file
specifications.column
- a positive value in the range defined by the file
specifications.IOException
- in the event of a non-recoverable I/O exception.public abstract float readValue(GridPoint gridPoint) throws IOException
gridPoint
- a valid instanceIOException
- in the event of a non-recoverable I/O exception.public abstract void writeValue(int row, int col, float value) throws IOException
The value Float.NaN is reserved for the representation of null data.
row
- a positive value in the range defined by the file
specifications.col
- a positive value in the range defined by the file
specifications.value
- an floating-point value.IOException
- in the event of an unrecoverable I/O exception.public abstract void writeValue(GridPoint gridPoint, float value) throws IOException
The value Float.NaN is reserved for the representation of null data.
gridPoint
- a valid instance giving coordinates within
the limits of the grid.value
- an floating-point value.IOException
- in the event of an unrecoverable I/O exception.public int[] readBlockInt(int row, int column, int nRows, int nColumns) throws IOException
index = row * nColumns + column where rows and columns are all numbered starting at zero.Accessing data in a block is often more efficient that accessing data one grid-value-at-a-time.
row
- the grid row index for the starting row of the blockcolumn
- the grid column index for the starting column of the blocknRows
- the number of rows in the block to be retrievednColumns
- the number of columns in the block to be retrievedIOException
- in the event of an I/O error.public float[] readBlock(int row, int column, int nRows, int nColumns) throws IOException
index = row * nColumns + column where rows and columns are all numbered starting at zero.Accessing data in a block is often more efficient that accessing data one grid-value-at-a-time.
row
- the grid row index for the starting row of the blockcolumn
- the grid column index for the starting column of the blocknRows
- the number of rows in the block to be retrievednColumns
- the number of columns in the block to be retrievedIOException
- in the event of an I/O error.public boolean isContinuous()
This method is intended to allow data providers to indicate to users how the information stored in this file can be used. Continuous data is suitable for interpolation, slope and tangent analysis, and similar applications. Discontinuous data cannot be interpolated and does not support calculus-based computations.
Copyright © 2022. All rights reserved.