|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgsfc.nssdc.cdf.CDFData
public class CDFData
This class acts as the glue between the Java code and the Java Native Interface (JNI) code. This class applies only to the Variable object. It handles its data. This class translates a multi-dimensional array data into a 1-dimensional (1D) array prior to sending data to the JNI code for processing. Similarly, data retrieved in 1D array from the JNI code is properly dimensioned for usage or further manipulation.
Variable
,
CDFException
Field Summary |
---|
Method Summary | |
---|---|
void |
delete()
See the description of the getName() method in this class. |
void |
dump()
Dump data information and values, one row at a time, to the stdErr. |
void |
dumpData()
Dumps variable data, one row at a time per record. |
java.lang.Object |
getData()
Returns an object that is properly dimensioned. |
long[] |
getDimCounts()
Gets the value of the dimension counts that represents the number of elements read or write starting at the location |
long[] |
getDimIndices()
Gets the starting dimension index within a record for a hyper get/put function. |
long[] |
getDimIntervals()
Gets the value of the dimension intervals that represent the number of elements to skip between reads or writes for a hyper get/put function. |
int[] |
getDimSizes()
Gets the dimension sizes of this variable. |
java.lang.String |
getName()
CDFData implements CDFObject to enable CDFDelegate calls. |
int |
getnDims()
Gets the dimensionality of this variable. |
java.lang.Object |
getRawData()
Returns an object of a 1-dimensional array, which presents a sequence of raw data values retrieved and presented by JNI from a CDF file. |
long |
getRecCount()
Gets the number of records to read or write for a hyper get/put function. |
long |
getRecInterval()
Gets the number of records to skip for a hyper get/put function. |
long |
getRecStart()
Gets the record number at which a hyper get/put function starts. |
void |
rename(java.lang.String name)
See the description of the getName() method in this class. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public java.lang.Object getData()
The following example retrieves the Temperature data. The user should know how the data was stored before casting the generic object to a variable.
Variable var = cdf.getVariable("Temperature"); CDFData data = var.getHyperDataObject (recNum, recCount, recInterval, dimIndicies, dimSizes, dimCounts); long[][] temperature = (long [][]) data.getData();
public java.lang.Object getRawData()
The following example retrieves the 2-D Temperature data. The user should know how to organize the data, e.g., number of records, row/column major, data type, data value sequence, etc.
Variable var = cdf.getVariable("Temperature"); CDFData data = var.getHyperDataObject (recNum, recCount, recInterval, dimIndicies, dimSizes, dimCounts); long[] temperature = (long []) data.getRawData();
public int getnDims()
Variable var = cdf.getVariable("Temperature"); CDFData data = var.getHyperDataObject (recNum, recCount, recInterval, dimIndicies, dimSizes, dimCounts); long[][] temperature = (long [][]) data.getData(); nDims = data.getnDims(); // Gives the dimenionality of temperature
public int[] getDimSizes()
public long getRecStart()
public long getRecCount()
public long getRecInterval()
public long[] getDimIndices()
public long[] getDimCounts()
public long[] getDimIntervals()
public void dumpData()
The following example retrieves the first record, comprised of 3x5 (3 rows and 5 columns) array, into a generic object and dumps its contents to screen one row at a time. In this case three rows will be displayed on a screen, each row containing 5 elements.
CDFData data; long[] dimIndices = {0,0}; long[] dimIntervals = {3,5}; long[] dimSizes = {1,1};data = var.getHyperDataObject(0L, // record start 1, // record counts 1, // record interval dimIndices, dimSizes, dimIntervals); data.dumpData();
public void dump()
public java.lang.String getName()
getName
in interface CDFObject
public void rename(java.lang.String name) throws CDFException
rename
in interface CDFObject
name
- the new object name
CDFException
- No exception is thrown since this method is a
placeholderpublic void delete() throws CDFException
delete
in interface CDFObject
CDFException
- No exception is thrown since this method is a
placeholder
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |