|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.esa.beam.framework.dataio.AbstractProductWriter
public abstract class AbstractProductWriter
The AbstractProductWriter class can be used as a base class for new product writer implementations.
writeProductNodes(org.esa.beam.framework.datamodel.Product, java.lang.Object)| Constructor Summary | |
|---|---|
AbstractProductWriter(ProductWriterPlugIn writerPlugIn)
Constructs a ProductWriter. |
|
| Method Summary | |
|---|---|
protected void |
checkOutput()
Utility method which ensures that an output is assigned to this writer. |
Object |
getOutput()
Retrives the current output destination object. |
protected Product |
getSourceProduct()
Returns the source product to be written or null if the writeProductNodes has not be
called so far. |
ProductWriterPlugIn |
getWriterPlugIn()
Returns the plug-in which created this product writer. |
boolean |
isIncrementalMode()
Returns whether this product writer writes only modified product nodes. |
protected boolean |
isInstanceOfValidOutputType(Object output)
Checks if the given object is an instance of one of the valid output types for this product writer. |
void |
removeBand(Band band)
Overwrite this method to physicaly delete a Band from the writer's output file. |
void |
setIncrementalMode(boolean enabled)
Enables resp. |
boolean |
shouldWrite(ProductNode node)
Returns wether the given product node is to be written. |
void |
writeProductNodes(Product product,
Object output)
Writes the in-memory representation of a data product. |
protected abstract void |
writeProductNodesImpl()
Writes the in-memory representation of a data product. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.esa.beam.framework.dataio.ProductWriter |
|---|
close, deleteOutput, flush, writeBandRasterData |
| Constructor Detail |
|---|
public AbstractProductWriter(ProductWriterPlugIn writerPlugIn)
ProductWriter. Since no output destination is set, the setOutput
method must be called before data can be written.
writerPlugIn - the plug-in which created this writer, must not be null
IllegalArgumentExceptionwriteProductNodes(org.esa.beam.framework.datamodel.Product, java.lang.Object)| Method Detail |
|---|
public ProductWriterPlugIn getWriterPlugIn()
getWriterPlugIn in interface ProductWriternullprotected Product getSourceProduct()
null if the writeProductNodes has not be
called so far.
public Object getOutput()
null if the
setOutput method has not been called so far.
getOutput in interface ProductWriter
public void writeProductNodes(Product product,
Object output)
throws IOException
Whether the band data - the actual pixel values - is written out immediately or later when pixels are flushed, is up to the implementation.
writeProductNodes in interface ProductWriterproduct - the in-memory representation of the data productoutput - an object representing a valid output for this writer, might be a ImageOutputStream
or other Object to use for future decoding.
IllegalArgumentException - if product is null.
IllegalArgumentException - if output is null or it's type is none of the
supported output types.
IOException - if an I/O error occurs
protected abstract void writeProductNodesImpl()
throws IOException
writeProductNodes(product,
output) of the AbstractProductWriter.
IllegalArgumentException - if output type is not one of the supported output sources.
IOException - if an I/O error occurs
protected void checkOutput()
throws IllegalStateException
IllegalStateException - if no output was set (output is null).protected boolean isInstanceOfValidOutputType(Object output)
true if soProductWriterPlugIn.getOutputTypes()public boolean shouldWrite(ProductNode node)
shouldWrite in interface ProductWriternode - the product node
true if sopublic void setIncrementalMode(boolean enabled)
setIncrementalMode in interface ProductWriterenabled - enables or disables progress listening.public boolean isIncrementalMode()
isIncrementalMode in interface ProductWritertrue if sopublic void removeBand(Band band)
Band from the writer's output file.
removeBand in interface ProductWriterband - The band to delete.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||