public class CDF extends java.lang.Object implements CDFObject, CDFConstants
CDF dataType | Java dataType | Read/Write |
CDF_BYTE | java.lang.Byte | Y/Y |
CDF_INT1 | java.lang.Byte | Y/Y |
CDF_UINT1 | java.lang.Short | Y/Y |
CDF_INT2 | java.lang.Short | Y/Y |
CDF_UINT2 | java.lang.Integer | Y/Y |
CDF_INT4 | java.lang.Integer | Y/Y |
CDF_UINT4 | java.lang.Long | Y/Y |
CDF_INT8 | java.lang.Long | Y/Y |
CDF_FLOAT | java.lang.Float | Y/Y |
CDF_REAL4 | java.lang.Float | Y/Y |
CDF_DOUBLE | java.lang.Double | Y/Y |
CDF_REAL8 | java.lang.Double | Y/Y |
CDF_EPOCH | java.lang.Double | Y/Y |
CDF_EPOCH16 | java.lang.Double[ | Y/Y |
CDF_TIME_TT2000 | java.lang.Long | Y/Y |
CDF_CHAR | java.lang.String | Y/Y |
CDF_UCHAR | java.lang.String | Y/Y |
Attribute
,
CDFException
,
Variable
AHUFF_COMPRESSION, ALPHAOSF1_DECODING, ALPHAOSF1_ENCODING, ALPHAVMSd_DECODING, ALPHAVMSd_ENCODING, ALPHAVMSg_DECODING, ALPHAVMSg_ENCODING, ALPHAVMSi_DECODING, ALPHAVMSi_ENCODING, ARM_BIG_DECODING, ARM_BIG_ENCODING, ARM_LITTLE_DECODING, ARM_LITTLE_ENCODING, ATTR_, ATTR_EXISTENCE_, ATTR_EXISTS, ATTR_MAXgENTRY_, ATTR_MAXrENTRY_, ATTR_MAXzENTRY_, ATTR_NAME_, ATTR_NAME_TRUNC, ATTR_NUMBER_, ATTR_NUMgENTRIES_, ATTR_NUMrENTRIES_, ATTR_NUMzENTRIES_, ATTR_SCOPE_, BACKWARD_, BACKWARDFILEoff, BACKWARDFILEon, BAD_ALLOCATE_RECS, BAD_ARGUMENT, BAD_ATTR_NAME, BAD_ATTR_NUM, BAD_BLOCKING_FACTOR, BAD_CACHE_SIZE, BAD_CDF_EXTENSION, BAD_CDF_ID, BAD_CDF_NAME, BAD_CDFSTATUS, BAD_CHECKSUM, BAD_COMPRESSION_PARM, BAD_DATA_TYPE, BAD_DECODING, BAD_DIM_COUNT, BAD_DIM_INDEX, BAD_DIM_INTERVAL, BAD_DIM_SIZE, BAD_ENCODING, BAD_ENTRY_NUM, BAD_FNC_OR_ITEM, BAD_FORMAT, BAD_INITIAL_RECS, BAD_MAJORITY, BAD_MALLOC, BAD_NEGtoPOSfp0_MODE, BAD_NUM_DIMS, BAD_NUM_ELEMS, BAD_NUM_STRINGS, BAD_NUM_VARS, BAD_READONLY_MODE, BAD_REC_COUNT, BAD_REC_INTERVAL, BAD_REC_NUM, BAD_SCOPE, BAD_SCRATCH_DIR, BAD_SPARSEARRAYS_PARM, BAD_VAR_NAME, BAD_VAR_NUM, BAD_zMODE, BADDATE_LEAPSECOND_UPDATED, BeginUnixTimeEPOCH, BeginUnixTimeEPOCH16, BLOCKINGFACTOR_TOO_SMALL, BLOCKINGFACTOR_TOO_SMALL2, CANNOT_ALLOCATE_RECORDS, CANNOT_CHANGE, CANNOT_COMPRESS, CANNOT_CONVERT_WIDECHAR, CANNOT_COPY, CANNOT_INSERT_RECORDS, CANNOT_SPARSEARRAYS, CANNOT_SPARSERECORDS, CDF_, CDF_ACCESS_, CDF_ATTR_NAME_LEN, CDF_ATTR_NAME_LEN256, CDF_BYTE, CDF_CACHESIZE_, CDF_CHAR, CDF_CHECKSUM_, CDF_CLOSE_ERROR, CDF_COMPRESSION_, CDF_COPYRIGHT_, CDF_COPYRIGHT_LEN, CDF_CREATE_ERROR, CDF_DECODING_, CDF_DELETE_ERROR, CDF_DOUBLE, CDF_ENCODING_, CDF_EPOCH, CDF_EPOCH16, CDF_EXISTS, CDF_FLOAT, CDF_FORMAT_, CDF_INCREMENT_, CDF_INFO_, CDF_INT1, CDF_INT2, CDF_INT4, CDF_INT8, CDF_INTERNAL_ERROR, CDF_LEAPSECONDLASTUPDATED_, CDF_MAJORITY_, CDF_MAX_DIMS, CDF_MAX_PARMS, CDF_MIN_DIMS, CDF_NAME_, CDF_NAME_TRUNC, CDF_NEGtoPOSfp0_MODE_, CDF_NUMATTRS_, CDF_NUMgATTRS_, CDF_NUMrVARS_, CDF_NUMvATTRS_, CDF_NUMzVARS_, CDF_OK, CDF_OPEN_ERROR, CDF_PATHNAME_LEN, CDF_READ_ERROR, CDF_READONLY_MODE_, CDF_REAL4, CDF_REAL8, CDF_RELEASE_, CDF_SAVE_ERROR, CDF_SCRATCHDIR_, CDF_STATUS_, CDF_STATUSTEXT_LEN, CDF_TIME_TT2000, CDF_UCHAR, CDF_UINT1, CDF_UINT2, CDF_UINT4, CDF_VAR_NAME_LEN, CDF_VAR_NAME_LEN256, CDF_VERSION_, CDF_WARN, CDF_WRITE_ERROR, CDF_zMODE_, CDFwithSTATS_, CHECKSUM_, CHECKSUM_ERROR, CHECKSUM_NOT_ALLOWED, CLOSE_, COLUMN_MAJOR, COMPRESS_CACHESIZE_, COMPRESSION_ERROR, CONFIRM_, CORRUPTED_V2_CDF, CORRUPTED_V3_CDF, CREATE_, CURgENTRY_EXISTENCE_, CURrENTRY_EXISTENCE_, CURzENTRY_EXISTENCE_, DATATYPE_MISMATCH, DATATYPE_SIZE_, DECOMPRESSION_ERROR, DECSTATION_DECODING, DECSTATION_ENCODING, DEFAULT_BYTE_PADVALUE, DEFAULT_CHAR_PADVALUE, DEFAULT_DOUBLE_PADVALUE, DEFAULT_EPOCH_PADVALUE, DEFAULT_EPOCH16_PADVALUE, DEFAULT_FLOAT_PADVALUE, DEFAULT_INT1_PADVALUE, DEFAULT_INT2_PADVALUE, DEFAULT_INT4_PADVALUE, DEFAULT_INT8_PADVALUE, DEFAULT_REAL4_PADVALUE, DEFAULT_REAL8_PADVALUE, DEFAULT_TT2000_PADVALUE, DEFAULT_UCHAR_PADVALUE, DEFAULT_UINT1_PADVALUE, DEFAULT_UINT2_PADVALUE, DEFAULT_UINT4_PADVALUE, DELETE_, DID_NOT_COMPRESS, EMPTY_COMPRESSED_CDF, END_OF_VAR, EPOCH_STRING_LEN, EPOCH_STRING_LEN_EXTEND, EPOCH1_STRING_LEN, EPOCH1_STRING_LEN_EXTEND, EPOCH2_STRING_LEN, EPOCH2_STRING_LEN_EXTEND, EPOCH3_STRING_LEN, EPOCH3_STRING_LEN_EXTEND, EPOCH4_STRING_LEN, EPOCH4_STRING_LEN_EXTEND, EPOCHx_FORMAT_MAX, EPOCHx_STRING_MAX, FILLED_TT2000_VALUE, FORCED_PARAMETER, FUNCTION_NOT_SUPPORTED, gENTRY_, gENTRY_DATA_, gENTRY_DATASPEC_, gENTRY_DATATYPE_, gENTRY_EXISTENCE_, gENTRY_NUMELEMS_, GET_, GETCDFCHECKSUM_, GETCDFFILEBACKWARD_, GETCDFVALIDATE_, GETLEAPSECONDSENVVAR_, GLOBAL_SCOPE, GZIP_COMPRESSION, HOST_DECODING, HOST_ENCODING, HP_DECODING, HP_ENCODING, HUFF_COMPRESSION, IA64VMSd_DECODING, IA64VMSd_ENCODING, IA64VMSg_DECODING, IA64VMSg_ENCODING, IA64VMSi_DECODING, IA64VMSi_ENCODING, IBM_PC_OVERFLOW, IBMPC_DECODING, IBMPC_ENCODING, IBMRS_DECODING, IBMRS_ENCODING, ILLEGAL_EPOCH_FIELD, ILLEGAL_EPOCH_VALUE, ILLEGAL_FOR_SCOPE, ILLEGAL_IN_zMODE, ILLEGAL_ON_V1_CDF, ILLEGAL_TT2000_VALUE, IS_A_NETCDF, LIB_COPYRIGHT_, LIB_INCREMENT_, LIB_RELEASE_, LIB_subINCREMENT_, LIB_VERSION_, MAC_DECODING, MAC_ENCODING, MD5_CHECKSUM, MULTI_FILE, MULTI_FILE_FORMAT, NA_FOR_VARIABLE, NEGATIVE_FP_ZERO, NEGtoPOSfp0off, NEGtoPOSfp0on, NETWORK_DECODING, NETWORK_ENCODING, NeXT_DECODING, NeXT_ENCODING, NO_ATTR_SELECTED, NO_CDF_SELECTED, NO_CHECKSUM, NO_COMPRESSION, NO_DELETE_ACCESS, NO_ENTRY_SELECTED, NO_MORE_ACCESS, NO_PADVALUE_SPECIFIED, NO_SPARSEARRAYS, NO_SPARSERECORDS, NO_STATUS_SELECTED, NO_SUCH_ATTR, NO_SUCH_CDF, NO_SUCH_ENTRY, NO_SUCH_RECORD, NO_SUCH_VAR, NO_VAR_SELECTED, NO_VARS_IN_CDF, NO_WRITE_ACCESS, NONE_CHECKSUM, NOT_A_CDF, NOT_A_CDF_OR_NOT_SUPPORTED, NOVARY, NULL_, OPEN_, OPTIMAL_ENCODING_TREES, OTHER_CHECKSUM, PAD_SPARSERECORDS, PPC_DECODING, PPC_ENCODING, PRECEEDING_RECORDS_ALLOCATED, PREV_SPARSERECORDS, PUT_, READ_ONLY_DISTRIBUTION, READ_ONLY_MODE, READONLYoff, READONLYon, rENTRY_, rENTRY_DATA_, rENTRY_DATASPEC_, rENTRY_DATATYPE_, rENTRY_EXISTENCE_, rENTRY_NAME_, rENTRY_NUMELEMS_, rENTRY_NUMSTRINGS_, rENTRY_STRINGSDATA_, RLE_COMPRESSION, RLE_OF_ZEROs, ROW_MAJOR, rVAR_, rVAR_ALLOCATEBLOCK_, rVAR_ALLOCATEDFROM_, rVAR_ALLOCATEDTO_, rVAR_ALLOCATERECS_, rVAR_BLOCKINGFACTOR_, rVAR_CACHESIZE_, rVAR_COMPRESSION_, rVAR_DATA_, rVAR_DATASPEC_, rVAR_DATATYPE_, rVAR_DIMVARYS_, rVAR_EXISTENCE_, rVAR_HYPERDATA_, rVAR_INITIALRECS_, rVAR_MAXallocREC_, rVAR_MAXREC_, rVAR_NAME_, rVAR_nINDEXENTRIES_, rVAR_nINDEXLEVELS_, rVAR_nINDEXRECORDS_, rVAR_NUMallocRECS_, rVAR_NUMBER_, rVAR_NUMELEMS_, rVAR_NUMRECS_, rVAR_PADVALUE_, rVAR_RECORDS_, rVAR_RECORDS_RENUMBER_, rVAR_RECVARY_, rVAR_RESERVEPERCENT_, rVAR_SEQDATA_, rVAR_SEQPOS_, rVAR_SPARSEARRAYS_, rVAR_SPARSERECORDS_, rVARs_CACHESIZE_, rVARs_DIMCOUNTS_, rVARs_DIMINDICES_, rVARs_DIMINTERVALS_, rVARs_DIMSIZES_, rVARs_MAXREC_, rVARs_NUMDIMS_, rVARs_RECCOUNT_, rVARs_RECDATA_, rVARs_RECINTERVAL_, rVARs_RECNUMBER_, SAVE_, SCRATCH_CREATE_ERROR, SCRATCH_DELETE_ERROR, SCRATCH_READ_ERROR, SCRATCH_WRITE_ERROR, SELECT_, SGi_DECODING, SGi_ENCODING, SINGLE_FILE, SINGLE_FILE_FORMAT, SOME_ALREADY_ALLOCATED, STAGE_CACHESIZE_, STATUS_TEXT_, STRING_NOT_UTF8_ENCODING, STRINGDELIMITER, SUN_DECODING, SUN_ENCODING, TOO_MANY_PARMS, TOO_MANY_VARS, TRY_TO_READ_NONSTRING_DATA, TT2000_0_STRING_LEN, TT2000_1_STRING_LEN, TT2000_2_STRING_LEN, TT2000_3_STRING_LEN, TT2000_4_STRING_LEN, TT2000_CDF_MAYNEEDUPDATE, TT2000_TIME_ERROR, TT2000_USED_OUTDATED_TABLE, UNABLE_TO_PROCESS_CDF, UNKNOWN_COMPRESSION, UNKNOWN_SPARSENESS, UNSUPPORTED_OPERATION, VALIDATE_, VALIDATEFILEoff, VALIDATEFILEon, VAR_ALREADY_CLOSED, VAR_CLOSE_ERROR, VAR_CREATE_ERROR, VAR_DELETE_ERROR, VAR_EXISTS, VAR_NAME_TRUNC, VAR_OPEN_ERROR, VAR_READ_ERROR, VAR_SAVE_ERROR, VAR_WRITE_ERROR, VARIABLE_SCOPE, VARY, VAX_DECODING, VAX_ENCODING, VIRTUAL_RECORD_DATA, zENTRY_, zENTRY_DATA_, zENTRY_DATASPEC_, zENTRY_DATATYPE_, zENTRY_EXISTENCE_, zENTRY_NAME_, zENTRY_NUMELEMS_, zENTRY_NUMSTRINGS_, zENTRY_STRINGSDATA_, ZLIB_COMPRESS_ERROR, ZLIB_UNCOMPRESS_ERROR, zMODEoff, zMODEon1, zMODEon2, zVAR_, zVAR_ALLOCATEBLOCK_, zVAR_ALLOCATEDFROM_, zVAR_ALLOCATEDTO_, zVAR_ALLOCATERECS_, zVAR_BLOCKINGFACTOR_, zVAR_CACHESIZE_, zVAR_COMPRESSION_, zVAR_DATA_, zVAR_DATASPEC_, zVAR_DATATYPE_, zVAR_DIMCOUNTS_, zVAR_DIMINDICES_, zVAR_DIMINTERVALS_, zVAR_DIMSIZES_, zVAR_DIMVARYS_, zVAR_EXISTENCE_, zVAR_HYPERDATA_, zVAR_INITIALRECS_, zVAR_MAXallocREC_, zVAR_MAXREC_, zVAR_NAME_, zVAR_nINDEXENTRIES_, zVAR_nINDEXLEVELS_, zVAR_nINDEXRECORDS_, zVAR_NUMallocRECS_, zVAR_NUMBER_, zVAR_NUMDIMS_, zVAR_NUMELEMS_, zVAR_NUMRECS_, zVAR_PADVALUE_, zVAR_RECCOUNT_, zVAR_RECINTERVAL_, zVAR_RECNUMBER_, zVAR_RECORDS_, zVAR_RECORDS_RENUMBER_, zVAR_RECVARY_, zVAR_RESERVEPERCENT_, zVAR_SEQDATA_, zVAR_SEQPOS_, zVAR_SPARSEARRAYS_, zVAR_SPARSERECORDS_, zVARs_CACHESIZE_, zVARs_MAXREC_, zVARs_RECDATA_, zVARs_RECNUMBER_
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this CDF file.
|
long |
confirmCDFCacheSize()
Gets the CDF cache size (the number of 512-byte cache buffers) set
for this CDF.
|
long |
confirmCompressCacheSize()
Gets the number of 512-byte cache buffers being used for the
compression scratch file (for the current CDF).
|
long |
confirmDecoding()
Gets the CDF decoding method defined for this CDF.
|
long |
confirmNegtoPosfp0()
Gets the -0.0 to 0.0 translation flag set for this CDF.
|
long |
confirmReadOnlyMode()
Gets the value of the read-only mode flag set for this CDF file.
|
long |
confirmStageCacheSize()
Gets the number of 512-byte cache buffers defined for the
staging scratch file.
|
long |
confirmzMode()
Gets the zMode set for this CDF.
|
static CDF |
create(java.lang.String path)
Creates a CDF file in the current directory.
|
static CDF |
create(java.lang.String path,
int flag)
Deprecated.
Use setFileBackward(long) method to set the file backward
flag and create(String) to create file instead.
|
void |
delete()
Deletes this CDF file.
|
void |
finalize()
Do the necessary cleanup when garbage collector reaps it.
|
Attribute |
getAttribute(long attrNum)
Gets the attribute for the given attribute number.
|
Attribute |
getAttribute(java.lang.String attrName)
Gets the attribute for the given attribute name.
|
long |
getAttributeID(java.lang.String attrName)
Gets the id of the given attribute.
|
java.util.Vector |
getAttributes()
Gets all the global and variable attributes defined for this CDF.
|
long |
getChecksum()
Gets the checksum method, if any, applied to the CDF.
|
static long |
getChecksumEnvVar()
Gets the value of the CDF_CHECKSUM environment variable.
|
java.lang.String |
getCompression()
Gets the string representation of the compression type and parameters
defined for this CDF.
|
long[] |
getCompressionParms()
Gets the compression parameters set for this CDF.
|
long |
getCompressionPct()
Gets the compression percentage set for this CDF.
|
long |
getCompressionType()
Gets the compression type set for this CDF.
|
java.lang.String |
getCopyright()
Gets the CDF copyright statement for this CDF.
|
CDFDelegate |
getDelegate()
This is a placeholder for future expansions/extensions.
|
long |
getEncoding()
Gets the encoding method defined for this CDF.
|
static boolean |
getFileBackward()
Gets the file backward flag.
|
static int |
getFileBackwardEnvVar()
Gets the value of the CDF_FILEBACKWARD environment variable.
|
long |
getFormat()
Gets the CDF format defined for this CDF.
|
java.util.Vector |
getGlobalAttributes()
Gets the global attributes defined for this CDF.
|
long |
getID()
Gets the id of this CDF file.
|
long |
getLeapSecondLastUpdated()
Gets the date that the CDF has the last leap second updated.
|
static java.lang.String |
getLeapSecondsTableEnvVar()
Gets the the CDF_LEAPSECONDSTABLE (or CDF$LEAPSECONDSTABLE on VMS)
environment variable.
|
static java.lang.String |
getLibraryCopyright()
Retrieve library copyright information associated with the CDF library.
|
static java.lang.String |
getLibraryVersion()
Retrieve library version/release/increment/sub_increment information
associated with the CDF library.
|
long |
getMajority()
Gets the variable majority defined for this CDF.
|
java.lang.String |
getName()
Gets the name of this CDF.
|
long |
getNumAttrs()
Gets the total number of global and variable attributes in this CDF.
|
long |
getNumGattrs()
Gets the number of global attributes in this CDF.
|
long |
getNumRvars()
Gets the number of r variables.
|
long |
getNumVars()
Gets the number of Z variables defined for this CDF.
|
long |
getNumVattrs()
Gets the number of variable attributes in this CDF.
|
long |
getNumZvars()
Gets the number of z variables in this CDF file.
|
java.util.Vector |
getOrphanAttributes()
Gets the variable attributes defined for this CDF that are not
associated with any variables.
|
java.util.Vector |
getRecord(long recNum,
long[] varIDs)
Retrieves a logical record that consists of single variable record(s)
from an arbitrary number of CDF variables.
|
java.util.Vector |
getRecord(long recNum,
long[] varIDs,
long[] status)
Retrieves a logical record that consists of single variable record(s)
from an arbitrary number of CDF variables.
|
java.util.Vector |
getRecord(long recNum,
java.lang.String[] strVars)
Retrieves a logical record that consists of single variable record(s)
from an arbitrary number of CDF variables.
|
java.util.Vector |
getRecord(long recNum,
java.lang.String[] strVars,
long[] status)
Retrieves a logical record that consists of single variable record(s)
from an arbitrary number of CDF variables.
|
long |
getStatus()
Gets the status of the most recent CDF JNI/library function call.
|
static java.lang.String |
getStatusText(long statusCode)
Gets the status text of the most recent CDF JNI/library function
call.
|
static boolean |
getValidate()
Gets the file validation mode.
|
Variable |
getVariable(long varNum)
Gets the variable object for the given variable number.
|
Variable |
getVariable(java.lang.String varName)
Gets the variable object for the given variable name.
|
java.util.Vector |
getVariableAttributes()
Gets the variable attributes defined for this CDF.
|
long |
getVariableID(java.lang.String varName)
Gets the ID of the given variable.
|
java.util.Vector |
getVariables()
Gets the z variables defined for this CDF.
|
java.lang.String |
getVersion()
Gets the CDF library version that was used to create this CDF
(e.g. 2.6.7, etc.).
|
static CDF |
open(java.lang.String path)
Open a CDF file for read/write, the default mode for opening a CDF.
|
static CDF |
open(java.lang.String path,
long readOnly)
Open a CDF file.
|
void |
putRecord(long recNum,
long[] varIDs,
java.util.Vector myData)
Writes a logical record that consists of single variable record(s)
from an arbitrary number of CDF variables.
|
void |
putRecord(long recNum,
long[] varIDs,
java.util.Vector myData,
long[] status)
Writes a logical record that consists of single variable record(s)
from an arbitrary number of CDF variables.
|
void |
putRecord(long recNum,
java.lang.String[] strVars,
java.util.Vector myData)
Writes a logical record that consists of single variable record(s)
from an arbitrary number of CDF variables.
|
void |
putRecord(long recNum,
java.lang.String[] strVars,
java.util.Vector myData,
long[] status)
Writes a logical record that consists of single variable record(s)
from an arbitrary number of CDF variables.
|
java.util.Map |
readCDF()
Gets the full CDF information.
|
java.util.Map |
readCDF(boolean encoding)
Gets the full CDF information.
|
java.util.Map |
readCDF(boolean encoding,
boolean basic,
boolean globals,
boolean varinfo)
Gets the specified information from a CDF.
|
java.util.Map |
readCDF(boolean encoding,
boolean basic,
boolean globals,
boolean varinfo,
boolean varmeta,
boolean vardata)
Gets the specified information from a CDF.
|
java.util.Map |
readCDF(boolean encoding,
boolean basic,
boolean globals,
boolean varinfo,
boolean varmeta,
boolean vardata,
boolean noentry)
Gets the specified information from a CDF.
|
java.util.Map |
readCDFGlobalAttributes()
Gets the global attributes and their entries defined for this CDF.
|
java.util.Map |
readCDFGlobalAttributes(boolean encoding)
Gets the global attributes and their entries defined for this CDF.
|
java.util.Map |
readCDFGlobalAttributes(long attrNum)
Gets a specified global attribute's entry(ies) defined for
this CDF.
|
java.util.Map |
readCDFGlobalAttributes(long[] attrNums)
Gets a specified list of global attributes and their entries defined for
this CDF.
|
java.util.Map |
readCDFGlobalAttributes(java.lang.Object attrs,
boolean encoding)
Gets a list of specified global attributes and their entries
defined for this CDF.
|
java.util.Map |
readCDFGlobalAttributes(java.lang.String attrName)
Gets a specified global attribute's entry(ies) defined for
this CDF.
|
java.util.Map |
readCDFGlobalAttributes(java.lang.String[] attrNames)
Gets a specified list of global attributes and their entries defined for
this CDF.
|
java.util.Map |
readCDFInfo()
Gets the basic information about this CDF.
|
java.util.Map |
readCDFNoEntryAttributes()
Gets a map of global attributes and variable attributes with no
entry data.
|
java.util.Map |
readCDFVariables()
Reads all variables' information in the CDF.
|
java.util.Map |
readCDFVariablesData()
Reads all variables' data in the CDF.
|
java.util.Map |
readCDFVariablesMetaData()
Reads all variables' metadata in the CDF.
|
java.util.Map |
readCDFVariablesSpec()
Reads all variables' specifications in the CDF.
|
void |
rename(java.lang.String path)
Renames the current CDF.
|
void |
save()
Saves this CDF file without closing.
|
void |
selectCDFCacheSize(long cacheSize)
Defines the number of 512-byte cache buffers to be used for the dotCDF
file (for the current CDF).
|
void |
selectCompressCacheSize(long compressCacheSize)
Sets the number of 512-byte cache buffers to be used for the compression
scratch file (for the current CDF).
|
void |
selectDecoding(long decoding)
Defines the CDF decoding method to be used for this CDF.
|
void |
selectNegtoPosfp0(long negtoPosfp0)
Defines whether to translate -0.0 to 0.0 for reading or writing.
|
void |
selectReadOnlyMode(long readOnly)
Sets the desired read-only mode.
|
void |
selectStageCacheSize(long stageCacheSize)
Sets the number of 512-byte cache buffers to be used for the staging
scratch file (for the current CDF).
|
void |
setChecksum(long checksum)
Specifies the checksum option applied to the CDF.
|
void |
setCompression(long cType,
long[] cParms)
Sets the compression type and parameters for this CDF.
|
void |
setDelegate(CDFDelegate delegate)
This is a placeholder for future expansions/extensions.
|
void |
setEncoding(long encoding)
Defines the encoding method to be used for this CDF.
|
static void |
setFileBackward(long flag)
Sets the file backward flag so that when a new CDF file is created,
it will be created in either in the older V2.7 version or the current
library version, i.e., V3.*.
|
void |
setFormat(long format)
Specifies the format of this CDF.
|
void |
setInfoWarningOff()
Sets the informational (status code < 0) or warning messages (status
code between -1 and -2000) coming from the CDF JNI/library function
off.
|
void |
setInfoWarningOn()
Sets the informational (status code < 0) or warning messages (status
code between -1 and -2000) coming from the CDF JNI/library function
on.
|
void |
setLeapSecondLastUpdated(long lastUpdated)
Set the leap second last updated for this CDF.
|
void |
setMajority(long majority)
Sets the variable majority for this CDF.
|
static void |
setValidate(long mode)
Sets the file validation mode so that when a CDF file is open,
it will be validated accordingly.
|
java.lang.String |
toString()
Gets the name of this CDF.
|
long |
verifyChecksum()
Verifies the data integrity of the CDF file from its checksum.
|
public static CDF create(java.lang.String path) throws CDFException
CDF cdf = null; cdf = CDF.create("test"); cdf.setFormat(MULTI_FILE);For the single-file format CDF, the above example would have created a single-file CDF called 'test.cdf'. See Chapter 1 of the CDF User's Guide for more information about the file format options. Notes:
CDF cdf1, cdf2, cdf3; CDF.setFileBackward(BACKWARDFILEon); cdf1 = CDF.create("test1"); cdf2 = CDF.create("test2"); CDF.setFileBackward(BACKWARDFILEoff); cdf3 = CDF.create("test3");Alternatively, use an environment variable to control the backward file creation. The environment variable CDF_FILEBACKWARD on Unix or Windows or CDF$FILEBACKWARD on Open/VMS is used. When it is set to TRUE, a V2.7 file(s) will be created automatically. In the following example, both test1.cdf and test2.cdf will be V2.7 if environment variable CDF_FILEBACKWARD (or CDF$FILEBACKWARD) is TRUE.
CDF cdf1 = CDF.create("test1"); CDF cdf2 = CDF.create("test2");
path
- the full pathname of the CDF file to be created CDFException
- if there was a problem creating a CDF filepublic static CDF create(java.lang.String path, int flag) throws CDFException
CDF cdf = null; cdf = CDF.create("test", 0);For the single-file format CDF, the above example would have created a single-file CDF called 'test.cdf'. The newly created file will be of the same version as the CDF library, To create a backward file, i.e., V2.7, use a differnt argument for the flag.
CDF cdf; cdf = CDF.create("test", 1);
path
- the full pathname of the CDF file to be created flag
- the file backward indicator flag. Passed 0 if a file of
current library version is to be created. Not 0 if a backward
is to be created.CDFException
- if there was a problem creating a CDF filepublic static CDF open(java.lang.String path) throws CDFException
CDF cdf = CDF.open(fileName, READONLYon);Note: Opening a file with read/write mode will cause the checksum signature to be recomputed every time the file is closed. (NEW) Each open CDF file is subjected to a default data validating process (some overheads) that will perform sanity checks. To overwrite it, you can use one of two ways: 1) Use the CDF static method setValidate before calling the open method: CDF.setValidate (VALIDATEFILEoff); 2) Set the environment variable CDF_VALIDATE (CDF$VALIDATE on VMS) to no
path
- the full pathname of the CDF file to be opened CDFException
- if there was a major problem opening a file
Not always that a CDFException will be thrown. It is good
pratice to check the status from this open method to see
if some others problems, e.g., invalid checksum is being
detected, may occur. Use something like the followings
if (cdf.getStatus() != CDF_OK) { if (cdf.getStatus() == CHECKSUM_ERROR) ...... }where cdf is the returned object from the open method. It is up to each individual to determine whether to continue to use a CDF file with an error like checksum.
public static CDF open(java.lang.String path, long readOnly) throws CDFException
CDF cdf = CDF.open(fileName, READONLYoff);
path
- the full pathname of the CDF file to be opened readOnly
- read-only flag that should be one the following:
CDFException
- if there was a major problem opening a file
Not always that a CDFException will be thrown. It is good
pratice to check the status from this open method to see
if some others problems, e.g., invalid checksum is being
detected, may occur. Use something like the followings
if (cdf.getStatus() != CDF_OK) { if (cdf.getStatus() == CHECKSUM_ERROR) ...... }where cdf is the returned object from the open method. It is up to each individual to determine whether to continue to use a CDF file with an error like checksum.
public static java.lang.String getLibraryVersion() throws CDFException
CDFException
- If there was a problem retrieving the
information associated with this CDF filepublic static java.lang.String getLibraryCopyright() throws CDFException
CDFException
- If there was a problem retrieving the
information associated with this CDF filepublic void close() throws CDFException
The following example closes a CDF file:
cdf.close();
CDFException
- if there was a problem closing the CDF filepublic long getID()
public long getEncoding()
public void setEncoding(long encoding) throws CDFException
encoding
- the encoding method to be used for this CDF that
should be one of the following:
CDFException
- if there was a problem setting the requested
encoding methodpublic void selectDecoding(long decoding) throws CDFException
decoding
- the decoding method to be used for this CDF that
should be one of the following:
CDFException
- if there was a problem selecting the
requested decoding methodpublic long confirmDecoding() throws CDFException
CDFException
- if there was a problem getting the
decoding method set for this CDF filepublic void selectCDFCacheSize(long cacheSize) throws CDFException
cacheSize
- the number of 512-byte cache buffers CDFException
- if there was a problem setting the CDF
cache sizepublic long confirmCDFCacheSize() throws CDFException
CDFException
- if there was a problem getting the CDF
cache sizepublic void selectNegtoPosfp0(long negtoPosfp0) throws CDFException
negtoPosfp0
- flag to translate -0.0 to 0.0 (NEGtoPOSfp0on = on,
NEGtoPOSfp0off = off) CDFException
- if there was a problem setting the -0.0 to
0.0 translation flagpublic long confirmNegtoPosfp0() throws CDFException
CDFException
- if there was a problem getting the value
of the -0.0 to 0.0 translation flagpublic long getFormat()
public void setFormat(long format) throws CDFException
format
- the CDF file format to be used that should be one
of the following:
CDFException
- if there was a problem setting a file formatpublic java.lang.String getVersion()
public long getMajority()
public void setMajority(long majority) throws CDFException
majority
- The majority to be used in storing data (ROW_MAJOR = row major,
COLUMN_MAJOR = column major) CDFException
- if a problem occurred in setting a majoritypublic long getNumAttrs()
public long getNumGattrs()
public long getNumVattrs()
public long getNumRvars()
public long getNumZvars()
public java.lang.String getCopyright()
public void selectReadOnlyMode(long readOnly) throws CDFException
readOnly
- read-only flag (READONLYon = on, READONLYoff = off) CDFException
- if a problem occurred in setting a flagpublic long confirmReadOnlyMode() throws CDFException
CDFException
- if a problem occurred in getting the value of
the read-only flag set for this CDF filepublic long getCompressionType()
public long getCompressionPct()
public long[] getCompressionParms()
public void setCompression(long cType, long[] cParms) throws CDFException
cType
- the compression type to be applied to this CDF that should
be one of the following:
cParms
- Compression parameter. There is only one parameter for
all the compression methods described above. CDFException
- if a problem occurred in setting the
compression type and parameterspublic java.lang.String getCompression() throws CDFException
CDFException
- if a problem occurred in getting the
compression type and parameters set for this CDFpublic long confirmzMode() throws CDFException
CDFException
- if a problem occurred in getting the zmode set
for this CDF filepublic void selectCompressCacheSize(long compressCacheSize) throws CDFException
compressCacheSize
- the number of 512-byte cache buffers to be
used CDFException
- if a problem occurs in setting the cache sizepublic long confirmCompressCacheSize() throws CDFException
CDFException
- if a problem occurs in getting the
cache size definedpublic void selectStageCacheSize(long stageCacheSize) throws CDFException
stageCacheSize
- the Number of cache buffers to be usedCDFException
- if a problem occurs in setting the
cache sizepublic long confirmStageCacheSize() throws CDFException
CDFException
- if a problem occurs in getting the number
of cache buffers defined for the staging scratch filepublic java.lang.String getName()
public void rename(java.lang.String path)
public void delete() throws CDFException
delete
in interface CDFObject
CDFException
- if a problem occurs in deleting this CDF filepublic void save() throws CDFException
CDFException
- if there was a problem saving the
contents of this CDF filepublic static void setFileBackward(long flag) throws CDFException
flag
- The flag indicates whether to create a new CDF(s) in the backward
version. BACKWARDFILEon means a backward file(s) is to be created
and BACKWARDFILEoff means a V3.* file(s) is to be created. CDFException
- if there was a problempublic static boolean getFileBackward()
public static int getFileBackwardEnvVar() throws CDFException
CDFException
- if there was a problempublic static java.lang.String getLeapSecondsTableEnvVar() throws CDFException
CDFException
- if there was a problempublic static long getChecksumEnvVar() throws CDFException
CDFException
- if there was a problempublic static void setValidate(long mode) throws CDFException
mode
- The mode indicates whether to validate CDF(s) while open.
VALIDATEFILEon means all files are subjected to ve validated.
VALIDATEFILEoff means no data validation will be performed. CDFException
- if there was a problempublic static boolean getValidate()
public long getStatus()
The following example sends a signal to the JNI code to write a single data to the current CDF. JNI in turn performs the requested operation. It then checks to see whether the requested operation was successfully performed or not.
variable.putSingleData(recNum, dimIndicies, data); long status = cdf.getStatus(); if (status != CDF_OK) { String statusText = CDF.getStatusText(status); System.out.println ("status = "+statusText); }
public static java.lang.String getStatusText(long statusCode)
The following example shows how to obtain the text representation of the status code returned from the getStatus method:
long status = cdf.getStatus(); if (status != CDF_OK) { String statusText = CDF.getStatusText(status); System.out.println ("status = "+statusText); }
statusCode
- status code to be translatedpublic void setInfoWarningOff()
public void setInfoWarningOn()
public java.lang.String toString()
toString
in class java.lang.Object
public void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
- if there was a problem doing cleanuppublic CDFDelegate getDelegate()
public void setDelegate(CDFDelegate delegate)
delegate
- The CDFDelegate executing the commandpublic long getAttributeID(java.lang.String attrName)
attrName
- the name of the attribute to check public Attribute getAttribute(long attrNum) throws CDFException
attrNum
- the attribute number to getCDFException
- if the supplied attribute number does not existpublic Attribute getAttribute(java.lang.String attrName) throws CDFException
The following example retrieves the attribute named "ValidMin":
Attribute validMin = cdf.getAttribute("ValidMin");
attrName
- the name of the attribute to get CDFException
- if the supplied attribute name does not existpublic java.util.Vector getAttributes()
Vector attr = cdf.getAttributes();
public java.util.Vector getGlobalAttributes()
public java.util.Map readCDFInfo()
public java.util.Map readCDFGlobalAttributes()
public java.util.Map readCDFGlobalAttributes(boolean encoding)
encoding
- A true/false flag to indicate whether to convert epoch
data type into encoded date/time string.public java.util.Map readCDFGlobalAttributes(java.lang.String attrName)
attrName
- Aglobal attribute namepublic java.util.Map readCDFGlobalAttributes(java.lang.String[] attrNames)
attrNames
- An array of global attribute namespublic java.util.Map readCDFGlobalAttributes(long attrNum)
attrNum
- A global attribute numberpublic java.util.Map readCDFGlobalAttributes(long[] attrNums)
attrNums
- An array of global attribute numberspublic java.util.Map readCDFGlobalAttributes(java.lang.Object attrs, boolean encoding)
attrs
- An array of attribute names of numbersencoding
- A true/false flag to indicate whether to convert epoch
data type into encoded date/time string.public java.util.Map readCDFNoEntryAttributes()
public java.util.Map readCDFVariables() throws CDFException
CDFException
- If there was a problem retrieving the variable
information from this CDF filepublic java.util.Map readCDFVariablesSpec() throws CDFException
CDFException
- If there was a problem retrieving the variable
information from this CDF filepublic java.util.Map readCDFVariablesMetaData() throws CDFException
CDFException
- If there was a problem retrieving the variable
information from this CDF filepublic java.util.Map readCDFVariablesData() throws CDFException
CDFException
- If there was a problem retrieving the variable
information from this CDF filepublic java.util.Map readCDF()
public java.util.Map readCDF(boolean encoding)
encoding
- A true/false flag indicates whether to encode epoch
data type from metadata to date/time string.public java.util.Map readCDF(boolean encoding, boolean basic, boolean globals, boolean varinfo)
encoding
- A true/false flag indicates whether to encode epoch
data type from metadata to date/time string.basic
- A true/false flag indicates whether to read the basic
information about the CDFglobals
- A true/false flag indicates whether to read the global
attributes in the CDFvarinfo
- A true/false flag indicates whether to read each variable's
information.public java.util.Map readCDF(boolean encoding, boolean basic, boolean globals, boolean varinfo, boolean varmeta, boolean vardata)
encoding
- A true/false flag indicates whether to encode epoch
data type from metadata to date/time string.basic
- A true/false flag indicates whether to read the basic
information about the CDFglobals
- A true/false flag indicates whether to read the global
attributes in the CDFvarinfo
- A true/false flag indicates whether to read each variable's
basic information.varmeta
- A true/false flag indicates whether to read each variable's
metadata.vardata
- A true/false flag indicates whether to read each variable's
data.public java.util.Map readCDF(boolean encoding, boolean basic, boolean globals, boolean varinfo, boolean varmeta, boolean vardata, boolean noentry)
Map acdf = cdf.readCDF(true, true, true, true, true, true); for (Object key : acdf.keySet()) { // May contain 3 key/value pairs: keys include "CDFinfo", // "GlobalAttributes" and "Variables". // Get key: "Variables"'s value -- a Map if (((String)key).equals("Variables")) { Map vars = (Map) acdf.get(key); if (vars == null) continue; for (Object varName : vars.keySet()) { // each key/value pair is variable name and its info System.out.println("** Variable: "+varName); Map var = (Map) vars.get(varName); // Each variable's info includes upto 3 key/value mappings: // "VarDef", "VarMetaData" and "VarData". for (Object key1 : var.keySet()) { if (key1.equals("VarSpec")) { // Key: "VarSpec" has Variable specification Map specs = var.get(key1); for (Object key2 : specs.keySet()) { .... .... } } else if (key1.equals("VarMetaData")) { // Key: "VarMeataData" has variable metadata Map meta = var.get(key1); for (Object key2 : meta.keySet()) { .... .... } } else if ((key1.equals("VarData")) { // Key: "VarData" has variable data Object data = var.get(key1); .... .... } else { error.... } } } } else { // other keys: "CDFinfo", "GloblaAttributes" and their values System.out.println(key + " - \n " + acdf.get(key)); } }
encoding
- A true/false flag indicates whether to encode epoch
data type from metadata to date/time string.basic
- A true/false flag indicates whether to read the basic
information about the CDFglobals
- A true/false flag indicates whether to read the global
attributes in the CDFvarinfo
- A true/false flag indicates whether to read each variable's
basic information.varmeta
- A true/false flag indicates whether to read each variable's
metadata.vardata
- A true/false flag indicates whether to read each variable's
data.noentry
- A true/false flag indicates whether to collect attributes
that have no entriespublic java.util.Vector getVariableAttributes()
public java.util.Vector getOrphanAttributes()
public long getVariableID(java.lang.String varName)
varName
- the name of the variable to check public Variable getVariable(long varNum) throws CDFException
varNum
- variable number from which the variable is retrieved CDFException
- if the supplied variable number does not existpublic Variable getVariable(java.lang.String varName) throws CDFException
The following example retrieves a variable called "Longitude":
Variable longitude = cdf.getVariable("Longitude");
varName
- the variable name to get CDFException
- if the supplied variable name does not existpublic java.util.Vector getVariables()
Note: Since all CDFs opened or created with the CDFJava APIs are placed into zMODE 2, there are no rVarialbles. All variables are treated as zVariables.
public long getNumVars()
public java.util.Vector getRecord(long recNum, java.lang.String[] strVars) throws CDFException
recNum
- the record number to retrieve data from strVars
- the variable (array of variable names) to retrieve
data fromCDFException
- if there was a problem getting a recordNote: A virtual variable record is returned if the given record does not exist. Any error during data retrieval will cause the process to stop (an exception thrown) and thus nothing (a null object) will be returned.
public java.util.Vector getRecord(long recNum, java.lang.String[] strVars, long[] status) throws CDFException
recNum
- the record number to retrieve data from strVars
- the variable (array of variable names) to retrieve
data fromstatus
- the individual status (array of statuses) for reading
each variable record CDFException
- if there was a problem getting a recordNote: A virtual variable record is returned if the given record does not exist. Any error during data retrieval will cause the process to stop (an exception thrown) and thus nothing (a null object) will be returned.
The following example reads the 2nd record from Longitude and Temperature and prints their contents.
String[] strVars = {"Longitude", "Temperature"}; Vector record; long[] status = new long[2]; record = cdf.getRecord(1L, strVars, status); // Check the contents of the 'status' array - optional // var: Longitude - data type: CDF_UINT2, dimensionality: 1:[3] System.out.print (" 2nd record of Longitude -- "); for (int i=0; i < 3; i++) System.out.print (((int[])record.elementAt(0))[i]+" "); System.out.println (""); // var: Temperature -- data type: CDF_REAL4, dimensionality: 1:[3] System.out.print (" 2nd record of Temperature -- "); for (int i=0; i < 3; i++) System.out.print (((float[])record.elementAt(1))[i]+" "); System.out.println ("");
public java.util.Vector getRecord(long recNum, long[] varIDs) throws CDFException
recNum
- the record number to retrieve data from varIDs
- the variable IDs (array of variable IDs) to retrieve
data fromCDFException
- if there was a problem getting a recordNote: A virtual variable record is returned if the given record does not exist. Any error during data retrieval will cause the process to stop (an exception thrown) and thus nothing (a null object) will be returned.
public java.util.Vector getRecord(long recNum, long[] varIDs, long[] status) throws CDFException
recNum
- the record number to retrieve data from varIDs
- the variable IDs (array of variable IDs) to retrieve
data fromstatus
- the individual status (array of statuses) for reading
each variable record CDFException
- if there was a problem getting a recordNote: A virtual variable record is returned if the given record does not exist. Any error during data retrieval will cause the process to stop (an exception thrown) and thus nothing (a null object) will be returned.
The following example reads the 2nd record from Longitude (varIds[0]) and Temperature (varIDs[1]) and prints their contents.
long[] varIDs = {2, 10}; // Obtained from Variable.getID() Vector record; long[] status = new long[2]; record = cdf.getRecord(1L, varIDs, status); // Check the contents of the 'status' array - optional // var: Longitude - data type: CDF_UINT2, dimensionality: 1:[3] System.out.print (" 2nd record of Longitude -- "); for (int i=0; i < 3; i++) System.out.print (((int[])record.elementAt(0))[i]+" "); System.out.println (""); // var: Temperature - data type: CDF_REAL4, dimensionality: 1:[3] System.out.print (" 2nd record of Temperature -- "); for (int i=0; i < 3; i++) System.out.print (((float[])record.elementAt(1))[i]+" "); System.out.println ("");
public void putRecord(long recNum, java.lang.String[] strVars, java.util.Vector myData) throws CDFException
recNum
- the record number to write data to strVars
- the variable (array of variable names) to write
data tomyData
- a Java vector that contains the variables' data. CDFException
- if there was a problem writing the record for
any of the variablesNote: Any error during the data writing will cause the process to stop (an exception thrown) and thus the operation will not be completed. Nothing will be done if the element counts of parameters don't match.
public void putRecord(long recNum, java.lang.String[] strVars, java.util.Vector myData, long[] status) throws CDFException
recNum
- the record number to write data to strVars
- the variable (array of variable names) to write
data tomyData
- a Java vector that contains the variables' data. status
- the individual status (array of statuses) for writing
each variable record CDFException
- if there was a problem writing the record for
any of the variables Note: Any error during the data writing will cause the process to stop (an exception thrown) and thus the operation will not be completed. Nothing will be done if the element counts of parameters don't match.
The following example writes the contents of a record (which consists of two CDF variables - Longitude and Temperature) to record number 2.
String[] strVars = {"Longitude", // variable names in CDF "Temperature"}; // Longitude -- data type: CDF_UINT2 dimensionality: 1:[3] int[] longitude_data = {333, 444, 555}; // Temperature -- data type: CDF_FLOAT dimensionality: 0:[] Float temperature_data = new Float((float)999.99); Vector record = new Vector(); record.add(longitude_data); record.add(temperature_data); cdf.putRecord(1L, strVars, record); // Write a record to record #2
public void putRecord(long recNum, long[] varIDs, java.util.Vector myData) throws CDFException
recNum
- the record number to write data to varIDs
- the variable IDs (array of variable IDs) to write
data tomyData
- a Java vector that contains the variables' data. CDFException
- if there was a problem writing the record for
any of the variables Note: Any error during the data writing will cause the process to stop (an exception thrown) and thus the operation will not be completed. Nothing will be done if the element counts of parameters don't match.
public void putRecord(long recNum, long[] varIDs, java.util.Vector myData, long[] status) throws CDFException
recNum
- the record number to write data to varIDs
- the variable IDs (array of variable IDs) to write
data tomyData
- a Java vector that contains the variables' data. status
- the individual status (array of statuses) for writing
each variable record CDFException
- if there was a problem writing the record for
any of the variables Note: Any error during the data writing will cause the process to stop (an exception thrown) and thus the operation will not be completed. Nothing will be done if the element counts of parameters don't match.
The following example writes the contents of a record (which consists of two CDF variables - Longitude and Temperature) by using variable IDs (instead of variable names) to record number 2.
long[] varIDs = {3, 9}; // Can be obtained from variable.getID() // Longitude -- data type: CDF_UINT2 dimensionality: 1:[3] int[] longitude_data = {333, 444, 555}; // Temperature -- data type: CDF_FLOAT dimensionality: 0:[] Float temperature_data = new Float((float)999.99); Vector record = new Vector(); record.add(longitude_data); record.add(temperature_data); cdf.putRecord(1L, varIDs, record); // Write a record to record #2
public void setChecksum(long checksum) throws CDFException
checksum
- the checksum option to be used for this CDF. Currently,
other than NO_CHECKSUM option, only MD5_CHECKSUM (using
MD5 checksum algorithm) is supported.CDFException
- if there was a problem with the passed option,
setting the checksum or other vital infomation
from this CDF file.public long getChecksum()
public void setLeapSecondLastUpdated(long lastUpdated) throws CDFException
lastUpdated
- The last date that the leap second was updated. It is
in YYYYMMDD form.CDFException
- If a problem occurred in setting the
desired field.public long getLeapSecondLastUpdated()
public long verifyChecksum() throws CDFException
CDFException
- if there was a problem getting the
checksum or other vital infomation from this CDF file