org.geotools.parameter
Class AbstractParameterDescriptor

java.lang.Object
  extended byorg.geotools.referencing.wkt.Formattable
      extended byorg.geotools.referencing.AbstractIdentifiedObject
          extended byorg.geotools.parameter.AbstractParameterDescriptor
All Implemented Interfaces:
org.opengis.parameter.GeneralParameterDescriptor, org.opengis.referencing.IdentifiedObject, java.io.Serializable
Direct Known Subclasses:
DefaultParameterDescriptor, DefaultParameterDescriptorGroup

public abstract class AbstractParameterDescriptor
extends AbstractIdentifiedObject
implements org.opengis.parameter.GeneralParameterDescriptor

Abstract definition of a parameter or group of parameters used by an operation method.

Since:
2.1
Version:
$Id: AbstractParameterDescriptor.java 17672 2006-01-19 00:25:55Z desruisseaux $
Author:
Martin Desruisseaux
See Also:
AbstractParameter, Serialized Form

Field Summary
 
Fields inherited from class org.geotools.referencing.AbstractIdentifiedObject
EMPTY_ALIAS_ARRAY, EMPTY_IDENTIFIER_ARRAY, IDENTIFIER_COMPARATOR, NAME_COMPARATOR, REMARKS_COMPARATOR
 
Fields inherited from interface org.opengis.referencing.IdentifiedObject
ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEY
 
Constructor Summary
protected AbstractParameterDescriptor(org.opengis.parameter.GeneralParameterDescriptor descriptor)
          Constructs a descriptor with the same values than the specified one.
protected AbstractParameterDescriptor(java.util.Map properties, int minimumOccurs, int maximumOccurs)
          Constructs a parameter from a set of properties.
 
Method Summary
abstract  org.opengis.parameter.GeneralParameterValue createValue()
          Creates a new instance of parameter value or group initialized with the default value(s).
 boolean equals(AbstractIdentifiedObject object, boolean compareMetadata)
          Compares the specified object with this parameter for equality.
protected  java.lang.String formatWKT(Formatter formatter)
          Format the inner part of a Well Known Text (WKT) element.
abstract  int getMaximumOccurs()
          The maximum number of times that values for this parameter group or parameter can be included.
 int getMinimumOccurs()
          The minimum number of times that values for this parameter group or parameter are required.
 int hashCode()
          Returns a hash value for this parameter.
 
Methods inherited from class org.geotools.referencing.AbstractIdentifiedObject
asSet, ensureAngularUnit, ensureLinearUnit, ensureNonNull, ensureNonNull, ensureTimeUnit, equals, equals, equals, equals, getAlias, getIdentifier, getIdentifier, getIdentifiers, getName, getName, getName, getProperties, getProperties, getRemarks, nameMatches, nameMatches
 
Methods inherited from class org.geotools.referencing.wkt.Formattable
toString, toWKT, toWKT, toWKT
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.opengis.referencing.IdentifiedObject
getAlias, getIdentifiers, getName, getRemarks, toWKT
 

Constructor Detail

AbstractParameterDescriptor

protected AbstractParameterDescriptor(org.opengis.parameter.GeneralParameterDescriptor descriptor)
Constructs a descriptor with the same values than the specified one. This copy constructor may be used in order to wraps an arbitrary implementation into a Geotools one.

Since:
2.2

AbstractParameterDescriptor

protected AbstractParameterDescriptor(java.util.Map properties,
                                      int minimumOccurs,
                                      int maximumOccurs)
Constructs a parameter from a set of properties. The properties map is given unchanged to the super-class constructor.

Parameters:
properties - Set of properties. Should contains at least .
minimumOccurs - The minimum number of times that values for this parameter group or parameter are required.
maximumOccurs - The maximum number of times that values for this parameter group or parameter are required. This value is used in order to check the range. For ParameterValue, it should always be 1.
Method Detail

createValue

public abstract org.opengis.parameter.GeneralParameterValue createValue()
Creates a new instance of parameter value or group initialized with the default value(s). The parameter value descriptor for the created parameter value(s) will be object.

Example implementation:

 return new Parameter(this);
 

Specified by:
createValue in interface org.opengis.parameter.GeneralParameterDescriptor

getMinimumOccurs

public int getMinimumOccurs()
The minimum number of times that values for this parameter group or parameter are required. The default value is one. A value of 0 means an optional parameter.

Specified by:
getMinimumOccurs in interface org.opengis.parameter.GeneralParameterDescriptor
See Also:
getMaximumOccurs()

getMaximumOccurs

public abstract int getMaximumOccurs()
The maximum number of times that values for this parameter group or parameter can be included. For a single parameter, the value is always 1. For a parameter group, it may vary.

Specified by:
getMaximumOccurs in interface org.opengis.parameter.GeneralParameterDescriptor
See Also:
getMinimumOccurs()

equals

public boolean equals(AbstractIdentifiedObject object,
                      boolean compareMetadata)
Compares the specified object with this parameter for equality.

Overrides:
equals in class AbstractIdentifiedObject
Parameters:
object - The object to compare to .
compareMetadata - for performing a strict comparaison, or for comparing only properties relevant to transformations.
Returns:
if both objects are equal.

hashCode

public int hashCode()
Returns a hash value for this parameter.

Overrides:
hashCode in class AbstractIdentifiedObject
Returns:
The hash code value. This value doesn't need to be the same in past or future versions of this class.

formatWKT

protected java.lang.String formatWKT(Formatter formatter)
Format the inner part of a Well Known Text (WKT) element. Note that WKT is not yet defined for parameter descriptor. Current implementation print only the name.

Overrides:
formatWKT in class Formattable
Parameters:
formatter - The formatter to use.
Returns:
The WKT element name, which is "PARAMETER"
See Also:
Formattable.toWKT(), Formattable.toString()


Copyright © GeoTools. All Rights Reserved.