org.geotools.coverage.processing
Class AbstractOperation

Object
  extended by AbstractOperation
All Implemented Interfaces:
Serializable, Operation
Direct Known Subclasses:
Operation2D

public abstract class AbstractOperation
extends Object
implements Operation, Serializable

Provides descriptive information for a coverage processing operation. The descriptive information includes such information as the name of the operation, operation description, and number of source grid coverages required for the operation.

Since:
2.2
Author:
Martin Desruisseaux (IRD)
See Also:
Serialized Form
Module:
modules/library/coverage (gt-coverage.jar)

Field Summary
protected  ParameterDescriptorGroup descriptor
          The parameters descriptor.
 
Constructor Summary
AbstractOperation(ParameterDescriptorGroup descriptor)
          Constructs an operation.
 
Method Summary
abstract  Coverage doOperation(ParameterValueGroup parameters, Hints hints)
          Applies a process operation to a coverage.
protected static void ensureNonNull(String name, Object object)
          Makes sure that an argument is non-null.
 boolean equals(Object object)
          Compares the specified object with this operation for equality.
 String getDescription()
          Deprecated. Return type need to be changed, maybe to InternationalString.
 String getDocURL()
          Deprecated. To be replaced by a method returning a Citation.
 String getName()
          Returns the name of the processing operation.
 int getNumSources()
          Returns the number of source coverages required for the operation.
 ParameterValueGroup getParameters()
          Returns an initially empty set of parameters.
protected static AbstractProcessor getProcessor(RenderingHints hints)
          Returns the AbstractProcessor instance used for an operation.
 String getVendor()
          Deprecated. Replaced by getName().getAuthority().
 String getVersion()
          Deprecated. Replacement to be determined.
 int hashCode()
          Returns a hash value for this operation.
 String toString()
          Returns a string representation of this operation.
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

descriptor

protected final ParameterDescriptorGroup descriptor
The parameters descriptor.

Constructor Detail

AbstractOperation

public AbstractOperation(ParameterDescriptorGroup descriptor)
Constructs an operation. The operation name will be the same than the parameter descriptor name.

Parameters:
descriptor - The parameters descriptor.
Method Detail

getName

public String getName()
Returns the name of the processing operation. The default implementation returns the descriptor code name.

Specified by:
getName in interface Operation

getDescription

@Deprecated
public String getDescription()
Deprecated. Return type need to be changed, maybe to InternationalString.

Returns the description of the processing operation. If there is no description, returns null. The default implementation returns the descriptor remarks.

Specified by:
getDescription in interface Operation

getDocURL

@Deprecated
public String getDocURL()
Deprecated. To be replaced by a method returning a Citation.

Returns the URL for documentation on the processing operation. If no online documentation is available the string will be null. The default implementation returns null.

Specified by:
getDocURL in interface Operation

getVersion

@Deprecated
public String getVersion()
Deprecated. Replacement to be determined.

Returns the version number of the implementation.

Specified by:
getVersion in interface Operation

getVendor

@Deprecated
public String getVendor()
Deprecated. Replaced by getName().getAuthority().

Returns the vendor name of the processing operation implementation. The default implementation returns "Geotools 2".

Specified by:
getVendor in interface Operation

getNumSources

public int getNumSources()
Returns the number of source coverages required for the operation.

Specified by:
getNumSources in interface Operation

getParameters

public ParameterValueGroup getParameters()
Returns an initially empty set of parameters.

Specified by:
getParameters in interface Operation

doOperation

public abstract Coverage doOperation(ParameterValueGroup parameters,
                                     Hints hints)
                              throws CoverageProcessingException
Applies a process operation to a coverage. This method is invoked by DefaultProcessor.

Parameters:
parameters - List of name value pairs for the parameters required for the operation.
hints - A set of rendering hints, or null if none. The DefaultProcessor may provides hints for the following keys: Hints.COORDINATE_OPERATION_FACTORY and Hints.JAI_INSTANCE.
Returns:
The result as a coverage.
Throws:
CoverageProcessingException - if the operation can't be applied.

getProcessor

protected static AbstractProcessor getProcessor(RenderingHints hints)
Returns the AbstractProcessor instance used for an operation. The instance is fetch from the rendering hints given to the doOperation(org.opengis.parameter.ParameterValueGroup, org.geotools.factory.Hints) method. If no processor is specified, then a default one is returned.

Parameters:
hints - The rendering hints, or null if none.
Returns:
The AbstractProcessor instance in use (never null).

ensureNonNull

protected static void ensureNonNull(String name,
                                    Object object)
                             throws IllegalArgumentException
Makes sure that an argument is non-null. This is a convenience method for implementations in subclasses.

Parameters:
name - Argument name.
object - User argument.
Throws:
IllegalArgumentException - if object is null.

hashCode

public int hashCode()
Returns a hash value for this operation. This value need not remain consistent between different implementations of the same class.

Overrides:
hashCode in class Object

equals

public boolean equals(Object object)
Compares the specified object with this operation for equality.

Overrides:
equals in class Object
Parameters:
object - The object to compare with this operation.
Returns:
true if the given object is equals to this operation.

toString

public String toString()
Returns a string representation of this operation. The returned string is implementation dependent. It is usually provided for debugging purposes only.

Overrides:
toString in class Object


Copyright © 1996-2010 Geotools. All Rights Reserved.