org.geotoolkit.coverage.sql
Class CoverageQuery

Object
  extended by CoverageQuery

public class CoverageQuery
extends Object

A request for data in a Coverage Database. A query contains the following components:

Every getter methods defined in this class return a direct reference to the objects holds by CoverageQuery - the objects are not cloned. This approach makes easier to configure a query by modifying directly the returned objects. Setter methods are provided for completness, but typically don't need to be invoked.

Since:
3.10
Version:
3.10
Author:
Martin Desruisseaux (Geomatys)
See Also:
CoverageDatabase.readSlice(CoverageQuery)
Module:
coverage/geotk-coverage-sql (download)    View source code for this class

Constructor Summary
CoverageQuery(CoverageDatabase database)
          Creates a new query for the given database.
 
Method Summary
 CoverageEnvelope getEnvelope()
          Returns the envelope of the coverage to be queried.
 IIOListeners getIIOListeners()
          Returns the listeners to inform about read progress.
 String getLayer()
          Returns the name of the layer to be requested, or null if unspecified.
 void setEnvelope(CoverageEnvelope newEnvelope)
          Sets the envelope of the coverage to be queried.
 void setIIOListeners(IIOListeners newListeners)
          Sets the listeners to inform about read progress.
 void setLayer(String name)
          Sets the name of the layer to be requested.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CoverageQuery

public CoverageQuery(CoverageDatabase database)
Creates a new query for the given database.

Parameters:
database - The database for which a query is created.
Method Detail

getLayer

public String getLayer()
Returns the name of the layer to be requested, or null if unspecified.

Returns:
The name of the layer to be requested, or null if unspecified.

setLayer

public void setLayer(String name)
Sets the name of the layer to be requested.

Parameters:
name - The name of the new layer to request.

getEnvelope

public CoverageEnvelope getEnvelope()
Returns the envelope of the coverage to be queried. This method returns a direct reference to the envelope holds by this class - any change to the returned envelope will affect directly this query.

Example: the following code defines the time for which a coverage is wanted:

Date startTime = ...;
Date endTime = ...;
query.getEnvelope().setTimeRange(startTime, endTime);

Returns:
The envelope of the coverage to be queried (never null).

setEnvelope

public void setEnvelope(CoverageEnvelope newEnvelope)
                 throws MismatchedReferenceSystemException
Sets the envelope of the coverage to be queried. This method is provided for completness with the getEnvelope() method, but usually don't need to be invoked since the object returne by getEnvelope() can be modified directly.

Parameters:
newEnvelope - The new envelope, or null for infinite bounds.
Throws:
MismatchedReferenceSystemException - If the given envelope uses an incompatible CRS.

getIIOListeners

public IIOListeners getIIOListeners()
Returns the listeners to inform about read progress. This method returns a direct reference to the listener list holds by this class - any change to the returned list will affect directly this query.

Example: the following code registers a IIOReadProgressListener which will be informed about the progress of any image file to be read:

query.getIIOListeners().addIIOReadProgressListener(myListener);

Returns:
The list of listeners to inform about read progress (never null).

setIIOListeners

public void setIIOListeners(IIOListeners newListeners)
Sets the listeners to inform about read progress. This method is provided for completness with the getIIOListeners() method, but usually don't need to be invoked since the object returne by getIIOListeners() can be modified directly.

Parameters:
newListeners - The new listeners, or null for none.


Copyright © 2009-2012 Geotoolkit.org. All Rights Reserved.