org.geotools.renderer.lite.gridcoverage2d
Class StyleVisitorCoverageProcessingNodeAdapter

Object
  extended by StyleVisitorAdapter
      extended by StyleVisitorCoverageProcessingNodeAdapter
All Implemented Interfaces:
CoverageProcessingNode, StyleVisitor
Direct Known Subclasses:
SubchainStyleVisitorCoverageProcessingAdapter

public abstract class StyleVisitorCoverageProcessingNodeAdapter
extends StyleVisitorAdapter
implements StyleVisitor, CoverageProcessingNode

This class implements an adapter to allow a CoverageProcessingNode to feed itself by visiting an SLD Style .

This class can be used to tie together CoverageProcessingNode s built from a chains as specified by the RasterSymbolizer SLd element.

Author:
Simone Giannecchini, GeoSolutions
Module:
modules/library/render (gt-render.jar)

Constructor Summary
StyleVisitorCoverageProcessingNodeAdapter(CoverageProcessingNode adaptee)
           
StyleVisitorCoverageProcessingNodeAdapter(InternationalString name, InternationalString description)
          Default constructor for StyleVisitorCoverageProcessingNodeAdapter
StyleVisitorCoverageProcessingNodeAdapter(int maxSources, Hints hints, InternationalString name, InternationalString description)
          Default constructor that gives users the possibility
StyleVisitorCoverageProcessingNodeAdapter(int maxSources, InternationalString name, InternationalString description)
          Default constructor that gives users the possibility
 
Method Summary
 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 all the resources used by this CoverageProcessingNode.
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()
           
protected  CoverageProcessingNode getAdaptee()
          Allows subclasses to access the CoverageProcessingNode we are adapting.
 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.
 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.
 GridCoverage getOutput()
          Forces this node to create the output coverage for the operation represented by this node.
 CoverageProcessingNode getSink(int index)
          Retrieves the sink located at index index in the List of sinks for this CoverageProcessingNode.
 List<CoverageProcessingNode> getSinks()
          Retrieves the List of sinks for this CoverageProcessingNode.
 CoverageProcessingNode getSource(int index)
          Retrieves the source located at index index in the List of sources for this CoverageProcessingNode.
 List<CoverageProcessingNode> getSources()
          Retrieves the List of source for this CoverageProcessingNode.
 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.
 
Methods inherited from class StyleVisitorAdapter
visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface StyleVisitor
visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
 

Constructor Detail

StyleVisitorCoverageProcessingNodeAdapter

public StyleVisitorCoverageProcessingNodeAdapter(CoverageProcessingNode adaptee)
Parameters:
adaptee -

StyleVisitorCoverageProcessingNodeAdapter

public StyleVisitorCoverageProcessingNodeAdapter(InternationalString name,
                                                 InternationalString description)
Default constructor for StyleVisitorCoverageProcessingNodeAdapter


StyleVisitorCoverageProcessingNodeAdapter

public StyleVisitorCoverageProcessingNodeAdapter(int maxSources,
                                                 InternationalString name,
                                                 InternationalString description)
Default constructor that gives users the possibility

Parameters:
maxSources - maximum number of sources allowed for this node.

StyleVisitorCoverageProcessingNodeAdapter

public StyleVisitorCoverageProcessingNodeAdapter(int maxSources,
                                                 Hints hints,
                                                 InternationalString name,
                                                 InternationalString description)
Default constructor that gives users the possibility

Parameters:
maxSources - maximum number of sources allowed for this node.
hints - instance of Hints class to control creation of internal factories. It can be null.
Method Detail

ensureSourceNotNull

protected static void ensureSourceNotNull(Object source,
                                          String name)
Checks whether the provided source object is null or not. If it is null it throws an IllegalArgumentException exception.

Parameters:
source - the object to check.
node - the operation we are trying to run.

ensureNotNull

protected static void ensureNotNull(Object source,
                                    String name)
Checks whether the provided object is null or not. If it is null it throws an IllegalArgumentException exception.

Parameters:
source - the object to check.
node - the operation we are trying to run.

getAdaptee

protected CoverageProcessingNode getAdaptee()
Allows subclasses to access the CoverageProcessingNode we are adapting.

Returns:
the adaptee
UML property:
name="adaptee"

execute

protected abstract GridCoverage execute()
See Also:
BaseCoverageProcessingNode.execute()

addSink

public void addSink(CoverageProcessingNode sink)
Description copied from interface: CoverageProcessingNode
Adds a sink CoverageProcessingNode to the list of sinks for this CoverageProcessingNode.

Specified by:
addSink in interface CoverageProcessingNode

addSource

public boolean addSource(CoverageProcessingNode source)
Description copied from interface: CoverageProcessingNode
Adds a source CoverageProcessingNode to the list of sources for this CoverageProcessingNode.

Specified by:
addSource in interface CoverageProcessingNode
Parameters:
source - the CoverageProcessingNode to add to the List of sources for this CoverageProcessingNode.
Returns:
true if everything goes fine, false otherwise.

getOutput

public GridCoverage getOutput()
Description copied from interface: CoverageProcessingNode
Forces this node to create the output coverage for the operation represented by this node.

Specified by:
getOutput in interface CoverageProcessingNode
Returns:
the Coverage which represents the output for this CoverageProcessingNode.

getSink

public CoverageProcessingNode getSink(int index)
Description copied from interface: CoverageProcessingNode
Retrieves the sink located at index index in the List of sinks for this CoverageProcessingNode.

Specified by:
getSink in interface CoverageProcessingNode
Parameters:
index - is the zero-based index for the source we want to access.
Returns:
the CoverageProcessingNode which represents the source at index index for this CoverageProcessingNode.

getSinks

public List<CoverageProcessingNode> getSinks()
Description copied from interface: CoverageProcessingNode
Retrieves the List of sinks for this CoverageProcessingNode. Each sink MUST be a CoverageProcessingNode.

Specified by:
getSinks in interface CoverageProcessingNode
Returns:
a List of CoverageProcessingNode which represents the sinks for this CoverageProcessingNode.

getSource

public CoverageProcessingNode getSource(int index)
Description copied from interface: CoverageProcessingNode
Retrieves the source located at index index in the List of sources for this CoverageProcessingNode.

Specified by:
getSource in interface CoverageProcessingNode
Parameters:
index - is the zero-based index for the sink we want to get.
Returns:
the CoverageProcessingNode which represents the sink at index index for this CoverageProcessingNode.

getSources

public List<CoverageProcessingNode> getSources()
Description copied from interface: CoverageProcessingNode
Retrieves the List of source for this CoverageProcessingNode. Each source MUST be a CoverageProcessingNode.

Specified by:
getSources in interface CoverageProcessingNode
Returns:
a List of CoverageProcessingNode which represents the sources for this CoverageProcessingNode.

removeSink

public boolean removeSink(CoverageProcessingNode sink)
Description copied from interface: CoverageProcessingNode
Removes a sink CoverageProcessingNode from the list of sinks for this CoverageProcessingNode.

Specified by:
removeSink in interface CoverageProcessingNode
Parameters:
sink - the CoverageProcessingNode to remove from the List of sinks for this CoverageProcessingNode.
Returns:
true in case we remove something, false otherwise.

removeSink

public CoverageProcessingNode removeSink(int index)
Description copied from interface: CoverageProcessingNode
Removes a sink CoverageProcessingNode from the list of sinks for this CoverageProcessingNode.

Specified by:
removeSink in interface CoverageProcessingNode
Parameters:
index - the index at which we want to remove a sink from the List of sinks for this CoverageProcessingNode.
Returns:
the CoverageProcessingNode we actually remove from the sinks list.

removeSource

public boolean removeSource(CoverageProcessingNode source)
Description copied from interface: CoverageProcessingNode
Removes a source CoverageProcessingNode to the list of sources for this CoverageProcessingNode.

Specified by:
removeSource in interface CoverageProcessingNode
Returns:
true in case we remove something, false otherwise.

removeSource

public CoverageProcessingNode removeSource(int index)
Description copied from interface: CoverageProcessingNode
Removes a source CoverageProcessingNode to the list of sources for this CoverageProcessingNode.

Specified by:
removeSource in interface CoverageProcessingNode
Parameters:
index - the index at which we want to remove a source from the List of sources for this CoverageProcessingNode.
Returns:
the CoverageProcessingNode we actually remove from the sources list.

dispose

public void dispose(boolean force)
Description copied from interface: CoverageProcessingNode
Disposes all the resources used by this CoverageProcessingNode.

Specified by:
dispose in interface CoverageProcessingNode
Parameters:
force - true to force disposal, false to suggest disposal.

getHints

public Hints getHints()
Description copied from interface: CoverageProcessingNode
Getter for Hints.

Specified by:
getHints in interface CoverageProcessingNode
Returns:
Hints provided at construction time to control GridCoverageFactory creation.

getCoverageFactory

public GridCoverageFactory getCoverageFactory()
Description copied from interface: CoverageProcessingNode
The GridCoverageFactory we will internally use for build intermediate and output GridCoverage2D.

Specified by:
getCoverageFactory in interface CoverageProcessingNode
Returns:
a GridCoverageFactory we will internally use for build intermediate and output GridCoverage2D.

getNumberOfSinks

public int getNumberOfSinks()
Description copied from interface: CoverageProcessingNode
Returns the number of sinks for this CoverageProcessingNode.

Specified by:
getNumberOfSinks in interface CoverageProcessingNode
Returns:
the number of sinks for this CoverageProcessingNode.

getNumberOfSources

public int getNumberOfSources()
Description copied from interface: CoverageProcessingNode
Returns the number of sources for this CoverageProcessingNode.

Specified by:
getNumberOfSources in interface CoverageProcessingNode
Returns:
the number of sources for this CoverageProcessingNode.

getDescription

public InternationalString getDescription()
Description copied from interface: CoverageProcessingNode
Retrieves the description for this CoverageProcessingNode

Specified by:
getDescription in interface CoverageProcessingNode
Returns:
the description for this CoverageProcessingNode

getName

public InternationalString getName()
Description copied from interface: CoverageProcessingNode
Retrieves the name for this CoverageProcessingNode

Specified by:
getName in interface CoverageProcessingNode
Returns:
the name for this CoverageProcessingNode

toString

public String toString()
Description copied from interface: CoverageProcessingNode
Provides a descriptive description for this CoverageProcessingNode.

Specified by:
toString in interface CoverageProcessingNode
Overrides:
toString in class Object
Returns:
a descriptive description for this CoverageProcessingNode


Copyright © 1996-2009 Geotools. All Rights Reserved.