public class CDFImpl.CDFVariable extends java.lang.Object implements java.io.Serializable, Variable
Modifier and Type | Field and Description |
---|---|
java.util.Vector |
attributes |
int |
compressionType |
int[] |
dimensions |
int |
number |
protected int |
numberOfValues |
java.lang.Object |
padValue |
boolean[] |
varies |
Constructor and Description |
---|
CDFVariable(long offset,
java.lang.String vtype) |
Modifier and Type | Method and Description |
---|---|
byte[] |
asByteArray()
Returns this variable's values as byte[] if variable type is byte,
unsigned byte or char.
|
byte[] |
asByteArray(int[] pt)
Returns this variable's values for a range of records as byte[] if
variable type is byte, unsigned byte or char.
|
byte[] |
asByteArray(int[] pt,
boolean columnMajor) |
double[] |
asDoubleArray()
Returns this variable's values as double[].
|
double[] |
asDoubleArray(boolean preserve,
int[] pt)
Returns this variable's values for the specified range of records as
double[].
|
double[] |
asDoubleArray(gov.nasa.gsfc.spdf.cdfj.CDFImpl.TargetAttribute tattr,
int[] pt) |
double[] |
asDoubleArray(int[] pt)
Returns this variable's values for the specified range of records as
double[].
|
float[] |
asFloatArray()
Returns this variable's values as float[].
|
float[] |
asFloatArray(boolean preserve,
int[] pt)
Returns this variable's values for the specified range of records as
float[].
|
float[] |
asFloatArray(int[] pt)
Returns this variable's values for the specified range of records as
float[].
|
int[] |
asIntArray()
Returns this variable's values as int[] for variables of type int,
short or unsigned short, byte or unsigned byte.
|
int[] |
asIntArray(boolean preserve,
int[] pt)
Returns this variable's values for the specified range of records as
int[] for variables of type int, short or unsigned short, byte or
unsigned byte, or unsigned int (only if preserve is false).
|
int[] |
asIntArray(int[] pt)
Returns this variable's values for the specified range of records as
int[] for variables of type int, short or unsigned short, byte or
unsigned byte.
|
long[] |
asLongArray()
Returns this variable's values as long[] for variables of type long.
|
long[] |
asLongArray(int[] pt)
Returns this variable's values for the specified range of records as
long[] for variables of type long.
|
short[] |
asShortArray()
Returns this variable's values as long[] for variables of type long.
|
short[] |
asShortArray(boolean preserve,
int[] pt)
Returns this variable's values for the specified range of records as
short[] for variables of type short, byte or unsigned byte, or
unsigned short (only if preserve is false).
|
short[] |
asShortArray(int[] pt)
Returns this variable's values for the specified range of records as
short[] for variables of type short, byte or unsigned byte.
|
int |
getBlockingFactor()
returns blocking factor used in compression
|
java.nio.ByteBuffer |
getBuffer() |
java.nio.ByteBuffer |
getBuffer(java.lang.Class cl,
int[] recordRange,
boolean preserve,
java.nio.ByteOrder bo)
Returns ByteBuffer containing uncompressed values converted to a
stream of numbers of the type specified by 'type' using the specified
byte ordering (specified by bo) for the specified range of records.
|
java.nio.ByteBuffer |
getBuffer(int[] recordRange) |
VDataContainer.CByte |
getByteContainer(int[] pt)
Returns byte
DataContainer for a
range of points. |
CDFImpl |
getCDF()
Returns
CDFImpl object containing this variable. |
int |
getCompressionType()
returns compression type
|
VariableDataBuffer[] |
getDataBuffers()
Gets an array of VariableDataBuffer objects that provide location of
data for this variable if this variable is not compressed.This method
throws a Throwable if invoked for a compressed variable.getBuffer method of VariableDataBuffer object returns a read only
ByteBuffer that contains data for this variable for a range of
records.
|
VariableDataBuffer[] |
getDataBuffers(boolean raw)
Gets an array of VariableDataBuffer objects that provide location of
data for this variable if this variable is not compressed.
|
int |
getDataItemSize()
returns size of value of this variable
|
int[] |
getDimensions()
Gets the dimensions.
|
VDataContainer.CDouble |
getDoubleContainer(int[] pt,
boolean preserve)
Returns double
DataContainer for a
range of points using native ByteOrder, optionally accepting possible
loss of precision. |
VDataContainer.CDouble |
getDoubleContainer(int[] pt,
boolean preserve,
java.nio.ByteOrder bo)
Returns double
DataContainer for a
range of points, optionally accepting possible loss of precision. |
int[] |
getEffectiveDimensions()
Returns effective dimensions
|
int |
getEffectiveRank()
returns effective rank
|
java.util.Vector |
getElementCount()
Return element count for this variable's dimensions.
|
VDataContainer.CFloat |
getFloatContainer(int[] pt,
boolean preserve)
Returns float
DataContainer for a
range of points using native ByteOrder, optionally accepting possible
loss of precision. |
VDataContainer.CFloat |
getFloatContainer(int[] pt,
boolean preserve,
java.nio.ByteOrder bo)
Returns float
DataContainer for a
range of points, optionally accepting possible loss of precision. |
VDataContainer.CInt |
getIntContainer(int[] pt,
boolean preserve)
Returns int
DataContainer for a
range of points using native ByteOrder, optionally accepting possible
loss of precision. |
VDataContainer.CInt |
getIntContainer(int[] pt,
boolean preserve,
java.nio.ByteOrder bo)
Returns int
DataContainer for a
range of points, optionally accepting possible loss of precision. |
VariableDataLocator |
getLocator()
Gets a list of regions that contain data for the variable.
|
VDataContainer.CLong |
getLongContainer(int[] pt)
Returns short
DataContainer for a
range of points using native ByteOrder. |
VDataContainer.CLong |
getLongContainer(int[] pt,
java.nio.ByteOrder bo)
Returns long
DataContainer for a
range of points. |
java.lang.String |
getName()
Gets the name of this of this variable
|
int |
getNumber()
Gets the sequence number of the variable inside the CDF.
|
int |
getNumberOfElements()
returns number of elements in the value of this variable
|
int |
getNumberOfValues()
returns number of values
|
java.lang.Object |
getPadValue()
returns pad value
|
java.lang.Object |
getPadValue(boolean preservePrecision)
Gets an object that represents a padded instance for a variable of
numeric type.
|
int[] |
getRecordRange()
Returns record range for this variable
|
VDataContainer.CShort |
getShortContainer(int[] pt,
boolean preserve)
Returns short
DataContainer for a
range of points using native ByteOrder, optionally accepting possible
loss of precision. |
VDataContainer.CShort |
getShortContainer(int[] pt,
boolean preserve,
java.nio.ByteOrder bo)
Returns short
DataContainer for a
range of points, optionally accepting possible loss of precision. |
VDataContainer.CString |
getStringContainer(int[] pt)
Returns String
DataContainer for a
range of points. |
int |
getType()
returns type of values of this variable
|
boolean[] |
getVarys()
Gets the dimensional variance.
|
boolean |
isCompatible(java.lang.Class cl)
returns whether conversion of this variable to type specified by cl
is supported while preserving precision.
|
boolean |
isCompatible(java.lang.Class cl,
boolean preserve)
returns whether conversion of this variable to type specified by cl
is supported under the given precision preserving constraint.
|
boolean |
isCompressed()
returns whether variable values have been compressed
|
boolean |
isMissingRecords()
Shows whether one or more records (in the range returned by
getRecordRange()) are missing.
|
boolean |
isTypeR() |
boolean |
missingRecordValueIsPad()
Return whether the missing record should be assigned the pad value.
|
boolean |
missingRecordValueIsPrevious()
Return whether the missing record should be assigned the last seen
value.
|
boolean |
padValueSpecified()
returns whether pad value is specified for this variable
|
boolean |
recordVariance()
returns whether value of this variable can vary from record to record
|
boolean |
rowMajority()
returns whether row major ordering is in use
|
public java.util.Vector attributes
public int number
protected int numberOfValues
public int[] dimensions
public boolean[] varies
public java.lang.Object padValue
public int compressionType
public boolean isTypeR()
isTypeR
in interface VariableMetaData
public boolean missingRecordValueIsPrevious()
missingRecordValueIsPrevious
in interface Variable
missingRecordValueIsPrevious
in interface VariableMetaData
public boolean missingRecordValueIsPad()
missingRecordValueIsPad
in interface Variable
missingRecordValueIsPad
in interface VariableMetaData
public boolean isMissingRecords()
isMissingRecords
in interface VariableMetaData
public VariableDataLocator getLocator()
getLocator
in interface VariableMetaData
public VariableDataBuffer[] getDataBuffers(boolean raw) throws java.lang.Throwable
getDataBuffers
in interface VariableMetaData
java.lang.Throwable
public VariableDataBuffer[] getDataBuffers() throws java.lang.Throwable
VariableMetaData
getDataBuffers
in interface VariableMetaData
java.lang.Throwable
public boolean rowMajority()
rowMajority
in interface VariableMetaData
public boolean recordVariance()
recordVariance
in interface VariableMetaData
public boolean padValueSpecified()
public boolean isCompressed()
isCompressed
in interface VariableMetaData
public java.lang.Object getPadValue()
getPadValue
in interface VariableMetaData
public java.lang.Object getPadValue(boolean preservePrecision)
getPadValue
in interface VariableMetaData
public CDFImpl getCDF()
Variable
CDFImpl
object containing this variable.public int getType()
getType
in interface VariableMetaData
public int getBlockingFactor()
getBlockingFactor
in interface VariableMetaData
public int getCompressionType()
getCompressionType
in interface VariableMetaData
public int getEffectiveRank()
getEffectiveRank
in interface VariableMetaData
public int[] getEffectiveDimensions()
getEffectiveDimensions
in interface Variable
getEffectiveDimensions
in interface VariableMetaData
public int getDataItemSize()
getDataItemSize
in interface VariableMetaData
public int getNumberOfElements()
getNumberOfElements
in interface VariableMetaData
public int getNumberOfValues()
getNumberOfValues
in interface VariableMetaData
public java.lang.String getName()
getName
in interface VariableMetaData
public int getNumber()
getNumber
in interface VariableMetaData
public int[] getDimensions()
getDimensions
in interface VariableMetaData
public int[] getRecordRange()
getRecordRange
in interface VariableMetaData
public boolean[] getVarys()
getVarys
in interface VariableMetaData
public java.nio.ByteBuffer getBuffer() throws java.lang.Throwable
java.lang.Throwable
public java.nio.ByteBuffer getBuffer(int[] recordRange) throws java.lang.Throwable
java.lang.Throwable
public java.nio.ByteBuffer getBuffer(java.lang.Class cl, int[] recordRange, boolean preserve, java.nio.ByteOrder bo) throws java.lang.Throwable
getBuffer
in interface VariableMetaData
java.lang.Throwable
public boolean isCompatible(java.lang.Class cl)
isCompatible
in interface VariableMetaData
public boolean isCompatible(java.lang.Class cl, boolean preserve)
isCompatible
in interface VariableMetaData
public VDataContainer.CByte getByteContainer(int[] pt) throws java.lang.Throwable
Variable
DataContainer
for a
range of points.getByteContainer
in interface Variable
java.lang.Throwable
- if variable type is not compatiblepublic byte[] asByteArray(int[] pt) throws java.lang.Throwable
asByteArray
in interface Variable
java.lang.Throwable
public byte[] asByteArray() throws java.lang.Throwable
asByteArray
in interface Variable
java.lang.Throwable
public byte[] asByteArray(int[] pt, boolean columnMajor) throws java.lang.Throwable
java.lang.Throwable
public VDataContainer.CString getStringContainer(int[] pt) throws java.lang.Throwable
Variable
DataContainer
for a
range of points.getStringContainer
in interface Variable
java.lang.Throwable
- if variable type is not compatiblepublic VDataContainer.CFloat getFloatContainer(int[] pt, boolean preserve, java.nio.ByteOrder bo) throws java.lang.Throwable
Variable
DataContainer
for a
range of points, optionally accepting possible loss of precision.getFloatContainer
in interface Variable
java.lang.Throwable
- if variable type is not compatiblepublic VDataContainer.CFloat getFloatContainer(int[] pt, boolean preserve) throws java.lang.Throwable
Variable
DataContainer
for a
range of points using native ByteOrder, optionally accepting possible
loss of precision.getFloatContainer
in interface Variable
java.lang.Throwable
- if variable type is not compatiblepublic float[] asFloatArray(boolean preserve, int[] pt) throws java.lang.Throwable
asFloatArray
in interface Variable
java.lang.Throwable
public float[] asFloatArray() throws java.lang.Throwable
asFloatArray
in interface Variable
java.lang.Throwable
public float[] asFloatArray(int[] pt) throws java.lang.Throwable
asFloatArray
in interface Variable
java.lang.Throwable
public VDataContainer.CDouble getDoubleContainer(int[] pt, boolean preserve, java.nio.ByteOrder bo) throws java.lang.Throwable
Variable
DataContainer
for a
range of points, optionally accepting possible loss of precision.getDoubleContainer
in interface Variable
java.lang.Throwable
- if variable type is not compatiblepublic VDataContainer.CDouble getDoubleContainer(int[] pt, boolean preserve) throws java.lang.Throwable
Variable
DataContainer
for a
range of points using native ByteOrder, optionally accepting possible
loss of precision.getDoubleContainer
in interface Variable
java.lang.Throwable
- if variable type is not compatiblepublic double[] asDoubleArray(boolean preserve, int[] pt) throws java.lang.Throwable
asDoubleArray
in interface Variable
java.lang.Throwable
public double[] asDoubleArray(gov.nasa.gsfc.spdf.cdfj.CDFImpl.TargetAttribute tattr, int[] pt) throws java.lang.Throwable
java.lang.Throwable
public double[] asDoubleArray() throws java.lang.Throwable
asDoubleArray
in interface Variable
java.lang.Throwable
public double[] asDoubleArray(int[] pt) throws java.lang.Throwable
asDoubleArray
in interface Variable
java.lang.Throwable
public VDataContainer.CLong getLongContainer(int[] pt, java.nio.ByteOrder bo) throws java.lang.Throwable
Variable
DataContainer
for a
range of points.getLongContainer
in interface Variable
java.lang.Throwable
- if variable type is not compatiblepublic VDataContainer.CLong getLongContainer(int[] pt) throws java.lang.Throwable
Variable
DataContainer
for a
range of points using native ByteOrder.getLongContainer
in interface Variable
java.lang.Throwable
- if variable type is not compatiblepublic long[] asLongArray() throws java.lang.Throwable
asLongArray
in interface Variable
java.lang.Throwable
public long[] asLongArray(int[] pt) throws java.lang.Throwable
asLongArray
in interface Variable
java.lang.Throwable
public VDataContainer.CInt getIntContainer(int[] pt, boolean preserve, java.nio.ByteOrder bo) throws java.lang.Throwable
Variable
DataContainer
for a
range of points, optionally accepting possible loss of precision.getIntContainer
in interface Variable
java.lang.Throwable
- if variable type is not compatiblepublic VDataContainer.CInt getIntContainer(int[] pt, boolean preserve) throws java.lang.Throwable
Variable
DataContainer
for a
range of points using native ByteOrder, optionally accepting possible
loss of precision.getIntContainer
in interface Variable
java.lang.Throwable
- if variable type is not compatiblepublic int[] asIntArray(boolean preserve, int[] pt) throws java.lang.Throwable
asIntArray
in interface Variable
java.lang.Throwable
public int[] asIntArray() throws java.lang.Throwable
asIntArray
in interface Variable
java.lang.Throwable
public int[] asIntArray(int[] pt) throws java.lang.Throwable
asIntArray
in interface Variable
java.lang.Throwable
public VDataContainer.CShort getShortContainer(int[] pt, boolean preserve, java.nio.ByteOrder bo) throws java.lang.Throwable
Variable
DataContainer
for a
range of points, optionally accepting possible loss of precision.getShortContainer
in interface Variable
java.lang.Throwable
- if variable type is not compatiblepublic VDataContainer.CShort getShortContainer(int[] pt, boolean preserve) throws java.lang.Throwable
Variable
DataContainer
for a
range of points using native ByteOrder, optionally accepting possible
loss of precision.getShortContainer
in interface Variable
java.lang.Throwable
- if variable type is not compatiblepublic short[] asShortArray(boolean preserve, int[] pt) throws java.lang.Throwable
asShortArray
in interface Variable
java.lang.Throwable
public short[] asShortArray() throws java.lang.Throwable
asShortArray
in interface Variable
java.lang.Throwable
public short[] asShortArray(int[] pt) throws java.lang.Throwable
asShortArray
in interface Variable
java.lang.Throwable
public java.util.Vector getElementCount()
getElementCount
in interface Variable
getElementCount
in interface VariableMetaData