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 VariableMetaDatapublic boolean missingRecordValueIsPrevious()
missingRecordValueIsPrevious in interface VariablemissingRecordValueIsPrevious in interface VariableMetaDatapublic boolean missingRecordValueIsPad()
missingRecordValueIsPad in interface VariablemissingRecordValueIsPad in interface VariableMetaDatapublic boolean isMissingRecords()
isMissingRecords in interface VariableMetaDatapublic VariableDataLocator getLocator()
getLocator in interface VariableMetaDatapublic VariableDataBuffer[] getDataBuffers(boolean raw) throws java.lang.Throwable
getDataBuffers in interface VariableMetaDatajava.lang.Throwablepublic VariableDataBuffer[] getDataBuffers() throws java.lang.Throwable
VariableMetaDatagetDataBuffers in interface VariableMetaDatajava.lang.Throwablepublic boolean rowMajority()
rowMajority in interface VariableMetaDatapublic boolean recordVariance()
recordVariance in interface VariableMetaDatapublic boolean padValueSpecified()
public boolean isCompressed()
isCompressed in interface VariableMetaDatapublic java.lang.Object getPadValue()
getPadValue in interface VariableMetaDatapublic java.lang.Object getPadValue(boolean preservePrecision)
getPadValue in interface VariableMetaDatapublic CDFImpl getCDF()
VariableCDFImpl object containing this variable.public int getType()
getType in interface VariableMetaDatapublic int getBlockingFactor()
getBlockingFactor in interface VariableMetaDatapublic int getCompressionType()
getCompressionType in interface VariableMetaDatapublic int getEffectiveRank()
getEffectiveRank in interface VariableMetaDatapublic int[] getEffectiveDimensions()
getEffectiveDimensions in interface VariablegetEffectiveDimensions in interface VariableMetaDatapublic int getDataItemSize()
getDataItemSize in interface VariableMetaDatapublic int getNumberOfElements()
getNumberOfElements in interface VariableMetaDatapublic int getNumberOfValues()
getNumberOfValues in interface VariableMetaDatapublic java.lang.String getName()
getName in interface VariableMetaDatapublic int getNumber()
getNumber in interface VariableMetaDatapublic int[] getDimensions()
getDimensions in interface VariableMetaDatapublic int[] getRecordRange()
getRecordRange in interface VariableMetaDatapublic boolean[] getVarys()
getVarys in interface VariableMetaDatapublic java.nio.ByteBuffer getBuffer()
throws java.lang.Throwable
java.lang.Throwablepublic java.nio.ByteBuffer getBuffer(int[] recordRange)
throws java.lang.Throwable
java.lang.Throwablepublic java.nio.ByteBuffer getBuffer(java.lang.Class cl,
int[] recordRange,
boolean preserve,
java.nio.ByteOrder bo)
throws java.lang.Throwable
getBuffer in interface VariableMetaDatajava.lang.Throwablepublic boolean isCompatible(java.lang.Class cl)
isCompatible in interface VariableMetaDatapublic boolean isCompatible(java.lang.Class cl,
boolean preserve)
isCompatible in interface VariableMetaDatapublic VDataContainer.CByte getByteContainer(int[] pt) throws java.lang.Throwable
VariableDataContainer for a
range of points.getByteContainer in interface Variablejava.lang.Throwable - if variable type is not compatiblepublic byte[] asByteArray(int[] pt)
throws java.lang.Throwable
asByteArray in interface Variablejava.lang.Throwablepublic byte[] asByteArray()
throws java.lang.Throwable
asByteArray in interface Variablejava.lang.Throwablepublic byte[] asByteArray(int[] pt,
boolean columnMajor)
throws java.lang.Throwable
java.lang.Throwablepublic VDataContainer.CString getStringContainer(int[] pt) throws java.lang.Throwable
VariableDataContainer for a
range of points.getStringContainer in interface Variablejava.lang.Throwable - if variable type is not compatiblepublic VDataContainer.CFloat getFloatContainer(int[] pt, boolean preserve, java.nio.ByteOrder bo) throws java.lang.Throwable
VariableDataContainer for a
range of points, optionally accepting possible loss of precision.getFloatContainer in interface Variablejava.lang.Throwable - if variable type is not compatiblepublic VDataContainer.CFloat getFloatContainer(int[] pt, boolean preserve) throws java.lang.Throwable
VariableDataContainer for a
range of points using native ByteOrder, optionally accepting possible
loss of precision.getFloatContainer in interface Variablejava.lang.Throwable - if variable type is not compatiblepublic float[] asFloatArray(boolean preserve,
int[] pt)
throws java.lang.Throwable
asFloatArray in interface Variablejava.lang.Throwablepublic float[] asFloatArray()
throws java.lang.Throwable
asFloatArray in interface Variablejava.lang.Throwablepublic float[] asFloatArray(int[] pt)
throws java.lang.Throwable
asFloatArray in interface Variablejava.lang.Throwablepublic VDataContainer.CDouble getDoubleContainer(int[] pt, boolean preserve, java.nio.ByteOrder bo) throws java.lang.Throwable
VariableDataContainer for a
range of points, optionally accepting possible loss of precision.getDoubleContainer in interface Variablejava.lang.Throwable - if variable type is not compatiblepublic VDataContainer.CDouble getDoubleContainer(int[] pt, boolean preserve) throws java.lang.Throwable
VariableDataContainer for a
range of points using native ByteOrder, optionally accepting possible
loss of precision.getDoubleContainer in interface Variablejava.lang.Throwable - if variable type is not compatiblepublic double[] asDoubleArray(boolean preserve,
int[] pt)
throws java.lang.Throwable
asDoubleArray in interface Variablejava.lang.Throwablepublic double[] asDoubleArray(gov.nasa.gsfc.spdf.cdfj.CDFImpl.TargetAttribute tattr,
int[] pt)
throws java.lang.Throwable
java.lang.Throwablepublic double[] asDoubleArray()
throws java.lang.Throwable
asDoubleArray in interface Variablejava.lang.Throwablepublic double[] asDoubleArray(int[] pt)
throws java.lang.Throwable
asDoubleArray in interface Variablejava.lang.Throwablepublic VDataContainer.CLong getLongContainer(int[] pt, java.nio.ByteOrder bo) throws java.lang.Throwable
VariableDataContainer for a
range of points.getLongContainer in interface Variablejava.lang.Throwable - if variable type is not compatiblepublic VDataContainer.CLong getLongContainer(int[] pt) throws java.lang.Throwable
VariableDataContainer for a
range of points using native ByteOrder.getLongContainer in interface Variablejava.lang.Throwable - if variable type is not compatiblepublic long[] asLongArray()
throws java.lang.Throwable
asLongArray in interface Variablejava.lang.Throwablepublic long[] asLongArray(int[] pt)
throws java.lang.Throwable
asLongArray in interface Variablejava.lang.Throwablepublic VDataContainer.CInt getIntContainer(int[] pt, boolean preserve, java.nio.ByteOrder bo) throws java.lang.Throwable
VariableDataContainer for a
range of points, optionally accepting possible loss of precision.getIntContainer in interface Variablejava.lang.Throwable - if variable type is not compatiblepublic VDataContainer.CInt getIntContainer(int[] pt, boolean preserve) throws java.lang.Throwable
VariableDataContainer for a
range of points using native ByteOrder, optionally accepting possible
loss of precision.getIntContainer in interface Variablejava.lang.Throwable - if variable type is not compatiblepublic int[] asIntArray(boolean preserve,
int[] pt)
throws java.lang.Throwable
asIntArray in interface Variablejava.lang.Throwablepublic int[] asIntArray()
throws java.lang.Throwable
asIntArray in interface Variablejava.lang.Throwablepublic int[] asIntArray(int[] pt)
throws java.lang.Throwable
asIntArray in interface Variablejava.lang.Throwablepublic VDataContainer.CShort getShortContainer(int[] pt, boolean preserve, java.nio.ByteOrder bo) throws java.lang.Throwable
VariableDataContainer for a
range of points, optionally accepting possible loss of precision.getShortContainer in interface Variablejava.lang.Throwable - if variable type is not compatiblepublic VDataContainer.CShort getShortContainer(int[] pt, boolean preserve) throws java.lang.Throwable
VariableDataContainer for a
range of points using native ByteOrder, optionally accepting possible
loss of precision.getShortContainer in interface Variablejava.lang.Throwable - if variable type is not compatiblepublic short[] asShortArray(boolean preserve,
int[] pt)
throws java.lang.Throwable
asShortArray in interface Variablejava.lang.Throwablepublic short[] asShortArray()
throws java.lang.Throwable
asShortArray in interface Variablejava.lang.Throwablepublic short[] asShortArray(int[] pt)
throws java.lang.Throwable
asShortArray in interface Variablejava.lang.Throwablepublic java.util.Vector getElementCount()
getElementCount in interface VariablegetElementCount in interface VariableMetaData