Class MetadataBuilder.Key

All Implemented Interfaces:
Enclosing class:

public static class MetadataBuilder.Key
extends java.lang.Object

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".

$Id: 17672 2006-01-19 00:25:55Z desruisseaux $
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


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

name - The key name.
Method Detail


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).

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


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).


public int hashCode()
Returns a hash code value.


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.