org.geotools.parameter
Class AbstractParameter

java.lang.Object
  extended by org.geotools.referencing.wkt.Formattable
      extended by org.geotools.parameter.AbstractParameter
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, org.opengis.parameter.GeneralParameterValue
Direct Known Subclasses:
FloatParameter, ImagingParameters, Parameter, ParameterGroup

public abstract class AbstractParameter
extends Formattable
implements org.opengis.parameter.GeneralParameterValue, java.io.Serializable

Abstract parameter value or group of parameter values.

Since:
2.1
Version:
$Id: AbstractParameter.java 30760 2008-06-18 14:28:24Z desruisseaux $
Author:
Martin Desruisseaux (IRD)
See Also:
AbstractParameterDescriptor, Serialized Form

Field Summary
 
Fields inherited from class org.geotools.referencing.wkt.Formattable
SINGLE_LINE
 
Constructor Summary
protected AbstractParameter(org.opengis.parameter.GeneralParameterDescriptor descriptor)
          Constructs a parameter value from the specified descriptor.
 
Method Summary
 AbstractParameter clone()
          Returns a copy of this parameter value or group.
 boolean equals(java.lang.Object object)
          Compares the specified object with this parameter for equality.
protected  java.lang.String formatWKT(Formatter formatter)
          Format the inner part of this parameter as Well Known Text (WKT).
 org.opengis.parameter.GeneralParameterDescriptor getDescriptor()
          Returns the abstract definition of this parameter or group of parameters.
 int hashCode()
          Returns a hash value for this parameter.
 java.lang.String toString()
          Returns a string representation of this parameter.
protected  void write(TableWriter table)
          Write the content of this parameter to the specified table.
 
Methods inherited from class org.geotools.referencing.wkt.Formattable
cleanupThreadLocals, toWKT, toWKT, toWKT
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractParameter

protected AbstractParameter(org.opengis.parameter.GeneralParameterDescriptor descriptor)
Constructs a parameter value from the specified descriptor.

Parameters:
descriptor - The abstract definition of this parameter or group of parameters.
Method Detail

getDescriptor

public org.opengis.parameter.GeneralParameterDescriptor getDescriptor()
Returns the abstract definition of this parameter or group of parameters.

Specified by:
getDescriptor in interface org.opengis.parameter.GeneralParameterValue

clone

public AbstractParameter clone()
Returns a copy of this parameter value or group.

Specified by:
clone in interface org.opengis.parameter.GeneralParameterValue
Overrides:
clone in class java.lang.Object

equals

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

Overrides:
equals in class java.lang.Object
Parameters:
object - The object to compare to this.
Returns:
true if both objects are equal.

hashCode

public int hashCode()
Returns a hash value for this parameter. This value doesn't need to be the same in past or future versions of this class.

Overrides:
hashCode in class java.lang.Object

toString

public final java.lang.String toString()
Returns a string representation of this parameter. The default implementation delegates the work to write(org.geotools.io.TableWriter), which should be overridden by subclasses.

Overrides:
toString in class Formattable

write

protected void write(TableWriter table)
              throws java.io.IOException
Write the content of this parameter to the specified table. This method make it easier to align values properly than overriding the toString() method. The table's columns are defined as below:
  1. The parameter name
  2. The separator
  3. The parameter value

The default implementation is suitable for most cases. However, subclasses are free to override this method with the following idiom:

 table.write("parameter name");
 table.nextColumn()
 table.write('=');
 table.nextColumn()
 table.write("parameter value");
 table.nextLine()
 

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

formatWKT

protected final java.lang.String formatWKT(Formatter formatter)
Format the inner part of this parameter as Well Known Text (WKT). This method doesn't need to be overridden, since the formatter already know how to format parameters.

Overrides:
formatWKT in class Formattable
Parameters:
formatter - The formatter to use.
Returns:
The name of the WKT element type (e.g. "GEOGCS").
See Also:
Formattable.toWKT(), Formattable.toString()


Copyright © 1996-2010 Geotools. All Rights Reserved.