org.esa.beam.framework.processor
Class ProductRef

java.lang.Object
  extended by org.esa.beam.framework.processor.ProductRef
All Implemented Interfaces:
Serializable

public class ProductRef
extends Object
implements Serializable

The ProductRef class serves as a leightweight information conatiner for products. It contains three fields:

See Also:
Serialized Form

Constructor Summary
ProductRef(File file)
          Constructs a new ProductRef instance with the given product URL.
ProductRef(File file, String fileFormat, String typeId)
          Constructs a new ProductRef instance with the given product file, file format and producttype ID.
 
Method Summary
 void addComponent(ProductRef component)
          Adds a component to the ProductRef.
 ProductRef getComponentAt(int index)
          Returns the component at given index or null if no components are set.
 File getFile()
           
 String getFileFormat()
          Returns the file format string.
 String getFilePath()
          Retrieves the file path of the product or null if no URL is set
 int getNumComponents()
          Returns the number of components available in the product
 String getTypeId()
          Returns the product type ID.
 void removeComponent(ProductRef component)
          Removes the component passed in from the component list.
 void setFile(File file)
           
 void setFileFormat(String fileFormat)
          Sets the file format string.
 void setTypeId(String typeId)
          Sets the type identifier for this class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProductRef

public ProductRef(File file)
           throws IllegalArgumentException
Constructs a new ProductRef instance with the given product URL. File format and product type ID are initially set to null.

Parameters:
file - the product file
Throws:
IllegalArgumentException

ProductRef

public ProductRef(File file,
                  String fileFormat,
                  String typeId)
Constructs a new ProductRef instance with the given product file, file format and producttype ID.

Parameters:
file - the product file
fileFormat - the file format
typeId - the product type ID
Method Detail

getFile

public File getFile()

setFile

public void setFile(File file)

getFilePath

public String getFilePath()
Retrieves the file path of the product or null if no URL is set


getTypeId

public String getTypeId()
Returns the product type ID.

Returns:
the product type ID, can be null

setTypeId

public void setTypeId(String typeId)
Sets the type identifier for this class.


getFileFormat

public String getFileFormat()
Returns the file format string.

Returns:
the file format string, can be null

setFileFormat

public void setFileFormat(String fileFormat)
Sets the file format string.

Parameters:
fileFormat - the file format string, can be null

addComponent

public void addComponent(ProductRef component)
Adds a component to the ProductRef. Creates the Vector if necessary.

Parameters:
component - the component to be added
Throws:
IllegalArgumentException

removeComponent

public void removeComponent(ProductRef component)
Removes the component passed in from the component list.

Parameters:
component - the component to be removed

getNumComponents

public int getNumComponents()
Returns the number of components available in the product


getComponentAt

public ProductRef getComponentAt(int index)
Returns the component at given index or null if no components are set.

Parameters:
index - the component index
Throws:
ArrayIndexOutOfBoundsException - if invalid index is supplied


Copyright © 2002-2012 Brockmann Consult GmbH. All Rights Reserved.