org.geotools.parameter
Class MatrixParameters

java.lang.Object
  extended byorg.geotools.referencing.wkt.Formattable
      extended byorg.geotools.parameter.AbstractParameter
          extended byorg.geotools.parameter.ParameterGroup
              extended byorg.geotools.parameter.MatrixParameters
All Implemented Interfaces:
org.opengis.util.Cloneable, java.lang.Cloneable, org.opengis.parameter.GeneralParameterDescriptor, org.opengis.parameter.GeneralParameterValue, org.opengis.referencing.IdentifiedObject, org.opengis.parameter.ParameterDescriptorGroup, org.opengis.parameter.ParameterValueGroup, java.io.Serializable

public class MatrixParameters
extends ParameterGroup
implements org.opengis.parameter.ParameterDescriptorGroup

The values for a group of matrix parameters. This value group is extensible, i.e. the number of "elt_row_col" parameters depends on the "num_row" and "num_col" parameter values. Consequently, this parameter value group is also its own mutable operation parameter group.

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

Field Summary
 
Fields inherited from class org.geotools.parameter.ParameterGroup
EMPTY
 
Fields inherited from interface org.opengis.referencing.IdentifiedObject
ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEY
 
Constructor Summary
MatrixParameters(MatrixParameterDescriptors descriptor)
          Constructs default values for the specified matrix parameter descriptors.
 
Method Summary
 java.lang.Object clone()
          Returns a clone of this parameter group.
 org.opengis.parameter.GeneralParameterValue createValue()
          Forward the call to the matrix parameter descriptors specified at construction time.
 org.opengis.parameter.GeneralParameterDescriptor descriptor(java.lang.String name)
          Returns the parameter in this group for the specified name.
 java.util.List descriptors()
          Returns the parameters descriptors in this group.
 boolean equals(java.lang.Object object)
          Compare this object with the specified one for equality.
 java.util.Collection getAlias()
          Forward the call to the matrix parameter descriptors specified at construction time.
 org.opengis.parameter.GeneralParameterDescriptor getDescriptor()
          Returns a description of this parameter value group.
 java.util.Set getIdentifiers()
          Forward the call to the matrix parameter descriptors specified at construction time.
 org.opengis.referencing.operation.Matrix getMatrix()
          Create a matrix from this group of parameters.
 int getMaximumOccurs()
          Forward the call to the matrix parameter descriptors specified at construction time.
 int getMinimumOccurs()
          Forward the call to the matrix parameter descriptors specified at construction time.
 org.opengis.metadata.Identifier getName()
          Forward the call to the matrix parameter descriptors specified at construction time.
 org.opengis.util.InternationalString getRemarks()
          Forward the call to the matrix parameter descriptors specified at construction time.
 org.opengis.parameter.ParameterValue parameter(int row, int column)
          Returns the value in this group for a matrix element at the specified index.
 org.opengis.parameter.ParameterValue parameter(java.lang.String name)
          Returns the value in this group for the specified name.
 void setMatrix(org.opengis.referencing.operation.Matrix matrix)
          Set all parameter values to the element value in the specified matrix.
 java.util.List values()
          Returns the parameters values in this group.
protected  void write(TableWriter table)
          Write the content of this parameter to the specified table.
 
Methods inherited from class org.geotools.parameter.ParameterGroup
addGroup, groups, hashCode
 
Methods inherited from class org.geotools.parameter.AbstractParameter
formatWKT, toString
 
Methods inherited from class org.geotools.referencing.wkt.Formattable
toWKT, toWKT, toWKT
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.opengis.referencing.IdentifiedObject
toWKT
 

Constructor Detail

MatrixParameters

public MatrixParameters(MatrixParameterDescriptors descriptor)
Constructs default values for the specified matrix parameter descriptors.

Method Detail

getDescriptor

public org.opengis.parameter.GeneralParameterDescriptor getDescriptor()
Returns a description of this parameter value group. Returns always , since the description depends on "num_row" and "num_col" parameter values.

Specified by:
getDescriptor in interface org.opengis.parameter.GeneralParameterValue
Overrides:
getDescriptor in class AbstractParameter

getName

public org.opengis.metadata.Identifier getName()
Forward the call to the matrix parameter descriptors specified at construction time.

Specified by:
getName in interface org.opengis.referencing.IdentifiedObject

getAlias

public java.util.Collection getAlias()
Forward the call to the matrix parameter descriptors specified at construction time.

Specified by:
getAlias in interface org.opengis.referencing.IdentifiedObject

getIdentifiers

public java.util.Set getIdentifiers()
Forward the call to the matrix parameter descriptors specified at construction time.

Specified by:
getIdentifiers in interface org.opengis.referencing.IdentifiedObject

getRemarks

public org.opengis.util.InternationalString getRemarks()
Forward the call to the matrix parameter descriptors specified at construction time.

Specified by:
getRemarks in interface org.opengis.referencing.IdentifiedObject

getMinimumOccurs

public int getMinimumOccurs()
Forward the call to the matrix parameter descriptors specified at construction time.

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

getMaximumOccurs

public int getMaximumOccurs()
Forward the call to the matrix parameter descriptors specified at construction time.

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

descriptor

public org.opengis.parameter.GeneralParameterDescriptor descriptor(java.lang.String name)
                                                            throws org.opengis.parameter.ParameterNotFoundException
Returns the parameter in this group for the specified name. The name can be a matrix element if it uses the following syntax: "elt_row_col" where "elt_" is the prefix for all matrix elements, and row and col are row and column indices respectively. For example "elt_2_1" is the element name for the value at line 2 and row 1. The row and column index are 0 based.

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

parameter

public org.opengis.parameter.ParameterValue parameter(java.lang.String name)
                                               throws org.opengis.parameter.ParameterNotFoundException
Returns the value in this group for the specified name. The name can be a matrix element if it uses the following syntax: "elt_row_col" where "elt_" is the prefix for all matrix elements, and row and col are row and column indices respectively. For example "elt_2_1" is the element name for the value at line 2 and row 1. The row and column index are 0 based.

Specified by:
parameter in interface org.opengis.parameter.ParameterValueGroup
Overrides:
parameter in class ParameterGroup
Parameters:
name - The case insensitive name of the parameter to search for.
Returns:
The parameter value for the given name.
Throws:
org.opengis.parameter.ParameterNotFoundException - if there is no parameter for the given name.

parameter

public final org.opengis.parameter.ParameterValue parameter(int row,
                                                            int column)
                                                     throws java.lang.IndexOutOfBoundsException
Returns the value in this group for a matrix element at the specified index. Row and column index are 0 based.

Parameters:
row - The row indice.
column - The column indice
Returns:
The parameter value for the specified matrix element (never ).
Throws:
java.lang.IndexOutOfBoundsException - if or is out of bounds.

descriptors

public java.util.List descriptors()
Returns the parameters descriptors in this group. The amount of parameters depends on the value of "num_row" and "num_col" parameters.

Specified by:
descriptors in interface org.opengis.parameter.ParameterDescriptorGroup

values

public java.util.List values()
Returns the parameters values in this group. The amount of parameters depends on the value of "num_row" and "num_col" parameters. The parameter array will contains only matrix elements which have been requested at least once by one of methods. Never requested elements are left to their default value and omitted from the returned array.

Specified by:
values in interface org.opengis.parameter.ParameterValueGroup
Overrides:
values in class ParameterGroup

createValue

public org.opengis.parameter.GeneralParameterValue createValue()
Forward the call to the matrix parameter descriptors specified at construction time.

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

getMatrix

public org.opengis.referencing.operation.Matrix getMatrix()
Create a matrix from this group of parameters.

Returns:
A matrix created from this group of parameters.

setMatrix

public void setMatrix(org.opengis.referencing.operation.Matrix matrix)
Set all parameter values to the element value in the specified matrix. After this method call, values() will returns only the elements different from the default value.

Parameters:
matrix - The matrix to copy in this group of parameters.

equals

public boolean equals(java.lang.Object object)
Compare this object with the specified one for equality.

Overrides:
equals in class ParameterGroup
Parameters:
object - The object to compare to .
Returns:
if both objects are equal.

clone

public java.lang.Object clone()
Returns a clone of this parameter group.

Specified by:
clone in interface org.opengis.parameter.ParameterValueGroup
Overrides:
clone in class ParameterGroup
Returns:
A copy of this group of parameter values.

write

protected void write(TableWriter table)
              throws java.io.IOException
Write the content of this parameter to the specified table.

Overrides:
write in class AbstractParameter
Parameters:
table - The table where to format the parameter value.
Throws:
java.io.IOException - if an error occurs during output operation.


Copyright © GeoTools. All Rights Reserved.