Main Page   Classes  

Public Member Functions | List of all members
Product Class Reference

Public Member Functions

 Product (String filename) throws CodaException
 
 Product (String filename, String product_class, String product_type, int version) throws CodaException
 
 Product (String filename, String product_class, String product_type) throws CodaException
 
void close () throws CodaException
 
String getFilename () throws CodaException
 
long getFileSize () throws CodaException
 
FormatEnum getFormat () throws CodaException
 
String getProductClass () throws CodaException
 
String getType () throws CodaException
 
int getVersion () throws CodaException
 
Type getRootType () throws CodaException
 
long getVariableValue (String variable, int index) throws CodaException
 

Detailed Description

CODA Product class.

The CODA Product class contains methods to open, close and retrieve information about product files that are supported by CODA.

Constructor & Destructor Documentation

◆ Product() [1/3]

Product ( String filename) throws CodaException

Construct an instance of a Product class representing a product file opened for reading.

In Java, this constructor is the equivalent of the coda_open() function in the C interface.

Parameters
filenameRelative or full path to the product file.
Exceptions
CodaExceptionIf an error occurred.

◆ Product() [2/3]

Product ( String filename,
String product_class,
String product_type,
int version ) throws CodaException

Construct an instance of a Product class representing a product file opened for reading, forcing the use of a specific version of a format definition.

In Java, this constructor is the equivalent of the coda_open_as() function in the C interface.

Parameters
filenameRelative or full path to the product file.
product_className of the product class for the requested format definition.
product_typeName of the product type for the requested format definition.
versionFormat version number of the product type definition. Use -1 to request the latest available definition.
Exceptions
CodaExceptionIf an error occurred.

◆ Product() [3/3]

Product ( String filename,
String product_class,
String product_type ) throws CodaException

Construct an instance of a Product class representing a product file opened for reading, forcing the use of the latest version of a specific format definition.

In Java, this constructor is the equivalent of the coda_open_as() function in the C interface.

Parameters
filenameRelative or full path to the product file.
product_className of the product class for the requested format definition.
product_typeName of the product type for the requested format definition.
Exceptions
CodaExceptionIf an error occurred.

Member Function Documentation

◆ close()

void close ( ) throws CodaException

Closes the open product file.

After calling this method the Product instance is no longer valid as the underlying file handle will have been released.

Exceptions
CodaExceptionIf an error occurred.

◆ getFilename()

String getFilename ( ) throws CodaException

Get the filename of a product file.

Returns
The filename of the product.
Exceptions
CodaExceptionIf an error occurred.

◆ getFileSize()

long getFileSize ( ) throws CodaException

Get the actual file size of a product file.

Returns
The actual file size (in bytes) of the product.
Exceptions
CodaExceptionIf an error occurred.

◆ getFormat()

FormatEnum getFormat ( ) throws CodaException

Get the basic file format of the product.

Returns
The format.
Exceptions
CodaExceptionIf an error occurred.

◆ getProductClass()

String getProductClass ( ) throws CodaException

Get the product class of a product file.

Returns
The class name of the product.
Exceptions
CodaExceptionIf an error occurred.

◆ getRootType()

Type getRootType ( ) throws CodaException

Get the CODA type of the root of the product.

Returns
The Type of the product.
Exceptions
CodaExceptionIf an error occurred.

◆ getType()

String getType ( ) throws CodaException

Get the product type of a product file.

Returns
The product type name of the product.
Exceptions
CodaExceptionIf an error occurred.

◆ getVariableValue()

long getVariableValue ( String variable,
int index ) throws CodaException

Get the value for a product variable.

Parameters
variableThe name of the product variable.
indexThe array index of the product variable (pass 0 if the variable is a scalar).
Returns
The product variable value.
Exceptions
CodaExceptionIf an error occurred.

◆ getVersion()

int getVersion ( ) throws CodaException

Get the product type version of a product file.

Returns
The product version of the product type of the product.
Exceptions
CodaExceptionIf an error occurred.