public abstract class BaseCoverageProcessingNode extends Object implements CoverageProcessingNode
CoverageProcessingNode .
This implementation provides convenient methods for managing sinks and source for a CoverageProcessingNode . The getOutput() is used to get the output of this CoverageProcessingNode (a CoverageProcessingException is thrown in case something bad
happens while processing
Implementors must implement the abstract method execute() which is guaranteed to run
in a critical section where the sources and sinks for this CoverageProcessingNode will
not be touched.
| Constructor and Description |
|---|
BaseCoverageProcessingNode(InternationalString name,
InternationalString description)
Default constructor
|
BaseCoverageProcessingNode(int maxSources,
Hints hints,
InternationalString name,
InternationalString description)
Default constructor that gives users the possibility
|
BaseCoverageProcessingNode(int maxSources,
InternationalString name,
InternationalString description)
Default constructor that gives users the possibility
|
| Modifier and Type | Method and Description |
|---|---|
void |
addSink(CoverageProcessingNode sink)
Adds a sink
CoverageProcessingNode to the list of sinks for this CoverageProcessingNode. |
boolean |
addSource(CoverageProcessingNode source)
Adds a source
CoverageProcessingNode to the list of sources for this CoverageProcessingNode. |
void |
dispose(boolean force)
Disposes this
CoverageProcessingNode along with all the resources it might have
allocated
The result for this CoverageProcessingNode is also disposed. |
protected static void |
ensureNotNull(Object source,
String name)
Checks whether the provided object is null or not.
|
protected static void |
ensureSourceNotNull(Object source,
String name)
Checks whether the provided source object is null or not.
|
protected abstract GridCoverage |
execute()
Subclasses MUST override this method in order to do the actual processing.
|
GridCoverageFactory |
getCoverageFactory()
The
GridCoverageFactory we will internally use for build intermediate and output
GridCoverage2D . |
InternationalString |
getDescription()
Retrieves the description for this
CoverageProcessingNode |
Hints |
getHints()
Getter for
Hints . |
int |
getMaximumNumberOfSources()
retrieves the maximum number of sources we are allowed to set for this
CoverageProcessingNode |
InternationalString |
getName()
Retrieves the name for this
CoverageProcessingNode |
int |
getNumberOfSinks()
Returns the number of sinks for this
CoverageProcessingNode. |
int |
getNumberOfSources()
Returns the number of sources for this
CoverageProcessingNode. |
GridCoverage2D |
getOutput()
This method is responsible for triggering the execution of this
CoverageProcessingNode and also of all its sources. |
CoverageProcessingNode |
getSink(int index)
|
List<CoverageProcessingNode> |
getSinks()
Retrieves the
List of sinks for this CoverageProcessingNode. |
CoverageProcessingNode |
getSource(int index)
|
List<CoverageProcessingNode> |
getSources()
Retrieves the
List of source for this CoverageProcessingNode. |
boolean |
isDisposed()
Tells me whether or not the node has been already disposed.
|
boolean |
isExecuted()
Tells me whether or not the node has been already executed.
|
boolean |
removeSink(CoverageProcessingNode sink)
Removes a sink
CoverageProcessingNode from the list of sinks for this CoverageProcessingNode. |
CoverageProcessingNode |
removeSink(int index)
Removes a sink
CoverageProcessingNode from the list of sinks for this CoverageProcessingNode. |
boolean |
removeSource(CoverageProcessingNode source)
Removes a source
CoverageProcessingNode to the list of sources for this CoverageProcessingNode. |
CoverageProcessingNode |
removeSource(int index)
Removes a source
CoverageProcessingNode to the list of sources for this CoverageProcessingNode. |
String |
toString()
Provides a descriptive description for this
CoverageProcessingNode. |
public BaseCoverageProcessingNode(InternationalString name, InternationalString description)
public BaseCoverageProcessingNode(int maxSources,
InternationalString name,
InternationalString description)
maxSources - maximum number of sources allowed for this node.description - name - public BaseCoverageProcessingNode(int maxSources,
Hints hints,
InternationalString name,
InternationalString description)
maxSources - maximum number of sources allowed for this node.hints - instance of Hints class to control creation of internal factories. It
can be null.description - name - protected abstract GridCoverage execute()
Note that this method is invoked through this framework hence it is run within a critical section. Be careful with what you do within this method since it is essentially an "alien" method running within a synch section, hence all sort of bad things can happen.
GridCoverage2D which is the result of the processing.public void dispose(boolean force)
CoverageProcessingNode along with all the resources it might have
allocated
The result for this CoverageProcessingNode is also disposed.
dispose in interface CoverageProcessingNodeforce - force the disposition of this node.public GridCoverage2D getOutput() throws CoverageProcessingException
CoverageProcessingNode and also of all its sources.
In case something bad happens a CoverageProcessingException is thrown.
getOutput in interface CoverageProcessingNodeCoverage which represents the output for this CoverageProcessingNode.CoverageProcessingExceptionpublic void addSink(CoverageProcessingNode sink)
CoverageProcessingNodeCoverageProcessingNode to the list of sinks for this CoverageProcessingNode.addSink in interface CoverageProcessingNodepublic boolean addSource(CoverageProcessingNode source)
CoverageProcessingNodeCoverageProcessingNode to the list of sources for this CoverageProcessingNode.addSource in interface CoverageProcessingNodesource - the CoverageProcessingNode to add to the List of sources for
this CoverageProcessingNode.true if everything goes fine, false otherwise.public CoverageProcessingNode getSink(int index)
CoverageProcessingNodegetSink in interface CoverageProcessingNodeindex - is the zero-based index for the source we want to access.CoverageProcessingNode which represents the source at index index
for this CoverageProcessingNode.public List<CoverageProcessingNode> getSinks()
CoverageProcessingNodeList of sinks for this CoverageProcessingNode. Each sink
MUST be a CoverageProcessingNode.getSinks in interface CoverageProcessingNodepublic CoverageProcessingNode getSource(int index)
CoverageProcessingNodegetSource in interface CoverageProcessingNodeindex - is the zero-based index for the sink we want to get.CoverageProcessingNode which represents the sink at index index
for this CoverageProcessingNode.public List<CoverageProcessingNode> getSources()
CoverageProcessingNodeList of source for this CoverageProcessingNode. Each source
MUST be a CoverageProcessingNode.getSources in interface CoverageProcessingNodepublic boolean removeSink(CoverageProcessingNode sink)
CoverageProcessingNodeCoverageProcessingNode from the list of sinks for this CoverageProcessingNode.removeSink in interface CoverageProcessingNodesink - the CoverageProcessingNode to remove from the List of sinks for
this CoverageProcessingNode.true in case we remove something, false otherwise.public CoverageProcessingNode removeSink(int index)
CoverageProcessingNodeCoverageProcessingNode from the list of sinks for this CoverageProcessingNode.removeSink in interface CoverageProcessingNodeindex - the index at which we want to remove a sink from the List of sinks for
this CoverageProcessingNode.CoverageProcessingNode we actually remove from the sinks list.public boolean removeSource(CoverageProcessingNode source)
CoverageProcessingNodeCoverageProcessingNode to the list of sources for this CoverageProcessingNode.removeSource in interface CoverageProcessingNodetrue in case we remove something, false otherwise.public Hints getHints()
Hints .getHints in interface CoverageProcessingNodeHints provided at construction time to control GridCoverageFactory
creation.public int getMaximumNumberOfSources()
CoverageProcessingNodeCoverageProcessingNodepublic GridCoverageFactory getCoverageFactory()
GridCoverageFactory we will internally use for build intermediate and output
GridCoverage2D .getCoverageFactory in interface CoverageProcessingNodeGridCoverageFactory we will internally use for build intermediate and
output GridCoverage2D .public int getNumberOfSinks()
CoverageProcessingNodeCoverageProcessingNode.getNumberOfSinks in interface CoverageProcessingNodeCoverageProcessingNode.public int getNumberOfSources()
CoverageProcessingNodeCoverageProcessingNode.getNumberOfSources in interface CoverageProcessingNodeCoverageProcessingNode.public InternationalString getDescription()
CoverageProcessingNodeCoverageProcessingNodegetDescription in interface CoverageProcessingNodepublic InternationalString getName()
CoverageProcessingNodeCoverageProcessingNodegetName in interface CoverageProcessingNodeprotected static void ensureSourceNotNull(Object source, String name)
IllegalArgumentException exception.source - the object to check.node - the operation we are trying to run.protected static void ensureNotNull(Object source, String name)
IllegalArgumentException exception.source - the object to check.node - the operation we are trying to run.public CoverageProcessingNode removeSource(int index) throws IndexOutOfBoundsException
CoverageProcessingNodeCoverageProcessingNode to the list of sources for this CoverageProcessingNode.removeSource in interface CoverageProcessingNodeindex - the index at which we want to remove a source from the List of sources
for this CoverageProcessingNode.CoverageProcessingNode we actually remove from the sources list.IndexOutOfBoundsExceptionpublic String toString()
CoverageProcessingNodeCoverageProcessingNode.toString in interface CoverageProcessingNodetoString in class ObjectCoverageProcessingNodepublic boolean isDisposed()
true if the node has been already disposed, false
otherwise.public boolean isExecuted()
true if the node has been already executed, false
otherwise.Copyright © 1996–2019 Geotools. All rights reserved.