org.geotoolkit.parameter
Class DefaultParameterDescriptorGroup

Object
  extended by FormattableObject
      extended by AbstractIdentifiedObject
          extended by AbstractParameterDescriptor
              extended by DefaultParameterDescriptorGroup
All Implemented Interfaces:
Serializable, Formattable, LenientComparable, GeneralParameterDescriptor, ParameterDescriptorGroup, IdentifiedObject
Direct Known Subclasses:
MatrixParameterDescriptors

@Immutable
public class DefaultParameterDescriptorGroup
extends AbstractParameterDescriptor
implements ParameterDescriptorGroup

The definition of a group of related parameters used by an operation method.

Since:
2.0
Version:
3.18
Author:
Martin Desruisseaux (IRD, Geomatys), Johann Sorel (Geomatys)
See Also:
ParameterGroup, DefaultParameterDescriptor, Serialized Form
Module:
referencing/geotk-referencing (download)    View source code for this class

Field Summary
 
Fields inherited from class FormattableObject
EPSG, GEOTIFF, INTERNAL, OGC, SINGLE_LINE
 
Fields inherited from interface IdentifiedObject
ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEY
 
Constructor Summary
DefaultParameterDescriptorGroup(Citation authority, String name, GeneralParameterDescriptor... parameters)
          Constructs a parameter group from a name and an authority.
DefaultParameterDescriptorGroup(Map<String,?> properties, GeneralParameterDescriptor... parameters)
          Constructs a parameter group from a set of properties.
DefaultParameterDescriptorGroup(Map<String,?> properties, int minimumOccurs, int maximumOccurs, GeneralParameterDescriptor... parameters)
          Constructs a parameter group from a set of properties.
DefaultParameterDescriptorGroup(ParameterDescriptorGroup group)
          Constructs a group with the same values than the specified one.
DefaultParameterDescriptorGroup(String name, GeneralParameterDescriptor... parameters)
          Constructs a parameter group from a name.
 
Method Summary
protected  int computeHashCode()
          Computes a hash value for this identified object.
 ParameterValueGroup createValue()
          Creates a new instance of parameter value group initialized with the default values.
 GeneralParameterDescriptor descriptor(String name)
          Returns the first parameter in this group for the specified identifier code.
 List<GeneralParameterDescriptor> descriptors()
          Returns the parameters in this group.
 boolean equals(Object object, ComparisonMode mode)
          Compares the specified object with this parameter group for equality.
 int getMaximumOccurs()
          The maximum number of times that values for this parameter group are required.
 String toString()
          Returns a string representation of this descriptor.
 
Methods inherited from class AbstractParameterDescriptor
formatWKT, getMinimumOccurs
 
Methods inherited from class AbstractIdentifiedObject
equals, getAlias, getIdentifier, getIdentifiers, getName, getName, getRemarks, hashCode, nameMatches
 
Methods inherited from class FormattableObject
getDefaultIndentation, print, setDefaultIndentation, toWKT, toWKT, toWKT
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface GeneralParameterDescriptor
getMinimumOccurs
 
Methods inherited from interface IdentifiedObject
getAlias, getIdentifiers, getName, getRemarks, toWKT
 

Constructor Detail

DefaultParameterDescriptorGroup

public DefaultParameterDescriptorGroup(ParameterDescriptorGroup group)
Constructs a group with the same values than the specified one. This copy constructor may be used in order to wraps an arbitrary implementation into a Geotk one.

Parameters:
group - The descriptor to copy.
Since:
2.2

DefaultParameterDescriptorGroup

public DefaultParameterDescriptorGroup(String name,
                                       GeneralParameterDescriptor... parameters)
Constructs a parameter group from a name. This parameter group will be required exactly once.

Parameters:
name - The parameter group name.
parameters - The parameter descriptors for this group.

DefaultParameterDescriptorGroup

public DefaultParameterDescriptorGroup(Citation authority,
                                       String name,
                                       GeneralParameterDescriptor... parameters)
Constructs a parameter group from a name and an authority. This parameter group will be required exactly once.

Parameters:
authority - The authority (e.g. OGC).
name - The parameter group name.
parameters - The parameter descriptors for this group.
Since:
2.2

DefaultParameterDescriptorGroup

public DefaultParameterDescriptorGroup(Map<String,?> properties,
                                       GeneralParameterDescriptor... parameters)
Constructs a parameter group from a set of properties. This parameter group will be required exactly once. The properties map is given unchanged to the super-class constructor.

Parameters:
properties - Set of properties. Should contains at least "name".
parameters - The parameter descriptors for this group.

DefaultParameterDescriptorGroup

public DefaultParameterDescriptorGroup(Map<String,?> properties,
                                       int minimumOccurs,
                                       int maximumOccurs,
                                       GeneralParameterDescriptor... parameters)
Constructs a parameter group 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 "name".
minimumOccurs - The minimum number of times that values for this parameter group are required.
maximumOccurs - The maximum number of times that values for this parameter group are required.
parameters - The parameter descriptors for this group.
Method Detail

getMaximumOccurs

public int getMaximumOccurs()
The maximum number of times that values for this parameter group are required.

Specified by:
getMaximumOccurs in interface GeneralParameterDescriptor
Specified by:
getMaximumOccurs in class AbstractParameterDescriptor
See Also:
AbstractParameterDescriptor.getMinimumOccurs()

createValue

public ParameterValueGroup createValue()
Creates a new instance of parameter value group initialized with the default values. The parameter descriptor for the created group will be this object.

Specified by:
createValue in interface GeneralParameterDescriptor
Specified by:
createValue in interface ParameterDescriptorGroup
Specified by:
createValue in class AbstractParameterDescriptor

descriptors

public List<GeneralParameterDescriptor> descriptors()
Returns the parameters in this group.

Specified by:
descriptors in interface ParameterDescriptorGroup

descriptor

public GeneralParameterDescriptor descriptor(String name)
                                      throws ParameterNotFoundException
Returns the first parameter in this group for the specified identifier code.

Specified by:
descriptor in interface ParameterDescriptorGroup
Parameters:
name - The case insensitive identifier code of the parameter to search for.
Returns:
The parameter for the given identifier code.
Throws:
ParameterNotFoundException - if there is no parameter for the given identifier code.

equals

public boolean equals(Object object,
                      ComparisonMode mode)
Compares the specified object with this parameter group for equality.

Specified by:
equals in interface LenientComparable
Overrides:
equals in class AbstractParameterDescriptor
Parameters:
object - The object to compare to this.
mode - STRICT for performing a strict comparison, or IGNORE_METADATA for comparing only properties relevant to transformations.
Returns:
true if both objects are equal.

computeHashCode

protected int computeHashCode()
Computes a hash value for this identified object. This method is invoked by AbstractIdentifiedObject.hashCode() when first needed.

Implementation specific feature
In the Geotk implementation, the name, identifiers and remarks are not used for hash code computation. Consequently two identified objects will return the same hash value if they are equal in the sense of equals(…, ComparisonMode.IGNORE_METADATA). This feature allows users to implement metadata-insensitive HashMap.

Overrides:
computeHashCode in class AbstractParameterDescriptor
Returns:
The hash code value. This value may change between different execution of the Geotk library.

toString

public String toString()
Returns a string representation of this descriptor. The default implementation delegates to ParameterWriter.toString(ParameterDescriptorGroup), which will format this descriptor in a table.

Overrides:
toString in class FormattableObject
Since:
3.17


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