org.geotools.coverage.io
Class MetadataBuilder.Key

java.lang.Object
  extended byorg.geotools.coverage.io.MetadataBuilder.Key
All Implemented Interfaces:
java.io.Serializable
Enclosing class:
MetadataBuilder

public static class MetadataBuilder.Key
extends java.lang.Object
implements java.io.Serializable

A key for fetching metadata in a format independent way. For example, the northern limit of an image way be named "Limit North" is some metadata files, and "ULY" (as Upper Left Y) in other metadata files. The MetadataBuilder.Y_MAXIMUM allows to fetch this metadata without knowledge of the actual name used in the underlying metadata file.

Keys are case-insensitive. Furthermore, trailing and leading spaces are ignored. Any succession of one ore more unicode whitespace characters (as of Character.isSpaceChar(char) is understood as equal to a single '_' character. For example, the key "false  easting" is considered equals to "false_easting".

Version:
$Id: MetadataBuilder.java 17672 2006-01-19 00:25:55Z desruisseaux $
Author:
Martin Desruisseaux
See Also:
Serialized Form

Constructor Summary
MetadataBuilder.Key(java.lang.String name)
          Construct a new key.
 
Method Summary
 boolean equals(java.lang.Object object)
          Compare this key with the supplied key for equality.
 java.lang.Object getValue(org.opengis.coverage.grid.GridCoverage coverage)
          Returns the value for this key from the specified grid coverage.
 int hashCode()
          Returns a hash code value.
 java.lang.String toString()
          Returns the name for this key.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MetadataBuilder.Key

public MetadataBuilder.Key(java.lang.String name)
Construct a new key.

Parameters:
name - The key name.
Method Detail

getValue

public java.lang.Object getValue(org.opengis.coverage.grid.GridCoverage coverage)
Returns the value for this key from the specified grid coverage. For example the key MetadataBuilder.X_MINIMUM will returns coverage.getEnvelope().getMinimum(0).

Parameters:
coverage - The grid coverage from which to fetch the value.
Returns:
The value, or if none.

toString

public java.lang.String toString()
Returns the name for this key. This is the name supplied to the constructor (i.e. case and whitespaces are preserved).


hashCode

public int hashCode()
Returns a hash code value.


equals

public boolean equals(java.lang.Object object)
Compare this key with the supplied key for equality. Comparaison is case-insensitive and considere any sequence of whitespaces as a single '_' character, as specified in this class documentation.



Copyright © GeoTools. All Rights Reserved.