deegree 2.1 (2007/11/08 09:57 build-328-official)

org.deegree.model.csct.ct
Class MathTransformProvider

java.lang.Object
  extended by org.deegree.model.csct.ct.MathTransformProvider
Direct Known Subclasses:
AbridgedMolodenskiTransform.Provider, GeocentricTransform.Provider, MapProjection.Provider, MatrixTransform.Provider

public abstract class MathTransformProvider
extends Object

Base class for MathTransform providers. Instance of this class allow the creation of transform objects from a classification name.

Note: this class is not part of OpenGIS specification and may change in a future version. Do not rely strongly on it.

Version:
1.0
Author:
Martin Desruisseaux

Field Summary
static javax.media.jai.ParameterListDescriptor DEFAULT_PROJECTION_DESCRIPTOR
          A default parameter list descriptor for map projections.
protected static javax.media.jai.util.Range LATITUDE_RANGE
          Range of latitude values.
protected static javax.media.jai.util.Range LONGITUDE_RANGE
          Range of longitude values.
protected static javax.media.jai.util.Range POSITIVE_RANGE
          Range of positives values.
 
Constructor Summary
(package private) MathTransformProvider(String classification, int nameKey, javax.media.jai.ParameterListDescriptor inherit)
          Construct a new provider.
protected MathTransformProvider(String classification, javax.media.jai.ParameterListDescriptor inherit)
          Construct a new provider.
 
Method Summary
abstract  MathTransform create(javax.media.jai.ParameterList parameters)
          Returns a transform for the specified parameters.
 String getClassName()
          Returns the classification name.
 String getName(Locale locale)
          Returns a human readable name localized for the specified locale.
 javax.media.jai.ParameterList getParameterList()
          Returns a newly created parameter list.
(package private)  javax.media.jai.ParameterListDescriptor getParameterListDescriptor()
          Returns the parameter list descriptor.
protected  void put(String parameter, double defaultValue, javax.media.jai.util.Range range)
          Adds or changes a parameter to this math transform provider.
(package private)  void putInt(String parameter, int defaultValue, javax.media.jai.util.Range range)
          Adds or changes an integer parameter to this math transform provider.
 String toString()
          Returns a string representation for this provider.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

POSITIVE_RANGE

protected static final javax.media.jai.util.Range POSITIVE_RANGE
Range of positives values. Range goes from 0 exclusive to positive infinity.


LONGITUDE_RANGE

protected static final javax.media.jai.util.Range LONGITUDE_RANGE
Range of longitude values. Range goes from -180� to +180� inclusives.


LATITUDE_RANGE

protected static final javax.media.jai.util.Range LATITUDE_RANGE
Range of latitude values. Range goes from -90� to +90� inclusives.


DEFAULT_PROJECTION_DESCRIPTOR

public static final javax.media.jai.ParameterListDescriptor DEFAULT_PROJECTION_DESCRIPTOR
A default parameter list descriptor for map projections. This descriptor declare "semi_major", "semi_minor", "central_meridian", "latitude_of_origin", "false_easting" and "false_northing" parameters.

Constructor Detail

MathTransformProvider

protected MathTransformProvider(String classification,
                                javax.media.jai.ParameterListDescriptor inherit)
Construct a new provider.

Parameters:
classification - The classification name.
inherit - The parameter list descriptor to inherit from, or null if there is none. All parameter descriptions from inherit will be copied into this newly created MathTransformProvider. For map projections, this argument may be DEFAULT_PROJECTION_DESCRIPTOR. Subclasses may add or change parameters in their constructor by invoking put(java.lang.String, double, javax.media.jai.util.Range).

MathTransformProvider

MathTransformProvider(String classification,
                      int nameKey,
                      javax.media.jai.ParameterListDescriptor inherit)
Construct a new provider.

Parameters:
classification - The classification name.
nameKey - Resources key for a human readable name. This is used for getName(java.util.Locale) implementation.
inherit - The parameter list descriptor to inherit from, or null if there is none. All parameter descriptions from inherit will be copied into this newly created MathTransformProvider. For map projections, this argument may be DEFAULT_PROJECTION_DESCRIPTOR. Subclasses may add or change parameters in their constructor by invoking put(java.lang.String, double, javax.media.jai.util.Range).
Method Detail

put

protected final void put(String parameter,
                         double defaultValue,
                         javax.media.jai.util.Range range)
                  throws IllegalStateException
Adds or changes a parameter to this math transform provider. If this MathTransformProvider has been constructed with DEFAULT_PROJECTION_DESCRIPTOR as argument, then default values are already provided for "semi_major", "semi_minor", "central_meridian" and "latitude_of_origin". Subclasses may call this method in their constructor for adding or changing parameters.

Parameters:
parameter - The parameter name.
defaultValue - The default value for this parameter, or Double.NaN if there is none.
range - The range of legal values. May be one of the predefined constants (POSITIVE_RANGE, LONGITUDE_RANGE, LATITUDE_RANGE) or any other Range object. May be null if all values are valid for this parameter.
Throws:
IllegalStateException - If getParameterList() has already been invoked prior to this call.

putInt

final void putInt(String parameter,
                  int defaultValue,
                  javax.media.jai.util.Range range)
           throws IllegalStateException
Adds or changes an integer parameter to this math transform provider. Support of integer values help to make the API clearer, but the true OpenGIS's parameter class support only double values. This is why this method is not yet public. Current SEAGIS version use integer parameters only for matrix dimension and for a custom parameter in geocentric transform. We hope the user will barely notice it...

Parameters:
parameter - The parameter name.
defaultValue - The default value for this parameter.
range - The range of legal values. This is up to the caller to build is own range with integer values (predefined ranges like POSITIVE_RANGE will not work).
Throws:
IllegalStateException - If getParameterList() has already been invoked prior to this call.

getClassName

public String getClassName()
Returns the classification name.


getName

public String getName(Locale locale)
Returns a human readable name localized for the specified locale. If no name is available for the specified locale, this method may returns a name in an arbitrary locale.


getParameterListDescriptor

final javax.media.jai.ParameterListDescriptor getParameterListDescriptor()
Returns the parameter list descriptor.


getParameterList

public javax.media.jai.ParameterList getParameterList()
Returns a newly created parameter list. The set of parameter depend of the transform this provider is for. Parameters may have default values and a range of validity.


create

public abstract MathTransform create(javax.media.jai.ParameterList parameters)
Returns a transform for the specified parameters.

Parameters:
parameters - The parameter values in standard units.
Returns:
A MathTransform object of this classification.

toString

public String toString()
Returns a string representation for this provider.

Overrides:
toString in class Object

deegree 2.1 (2007/11/08 09:57 build-328-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://deegree.sourceforge.net