org.geotoolkit.referencing.adapters
Class NetcdfIdentifiedObject

Object
  extended by NetcdfIdentifiedObject
All Implemented Interfaces:
Identifier, IdentifiedObject, ReferenceIdentifier
Direct Known Subclasses:
NetcdfAxis, NetcdfCRS, NetcdfProjection

public abstract class NetcdfIdentifiedObject
extends Object
implements IdentifiedObject, ReferenceIdentifier

Base class of wrappers around NetCDF objects. All methods in this class delegate their work to the wrapped NetCDF object. Consequently any change in the wrapped object is immediately reflected in this NetcdfIdentifiedObject instance. However users are encouraged to not change the wrapped object after construction, since GeoAPI referencing objects are expected to be immutable.

This base class assumes that NetCDF objects have a single name and no alias. This assumption allows us to implement directly the ReferenceIdentifier interface. The NetCDF object name is returned by the getCode() method.

Since:
3.08
Version:
3.08
Author:
Martin Desruisseaux (Geomatys)
Module:
coverage/geotk-coverageio-netcdf (download)    View source code for this class

Field Summary
 
Fields inherited from interface IdentifiedObject
ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEY
 
Fields inherited from interface ReferenceIdentifier
CODESPACE_KEY, VERSION_KEY
 
Fields inherited from interface Identifier
AUTHORITY_KEY, CODE_KEY
 
Constructor Summary
protected NetcdfIdentifiedObject()
          Creates a new NetcdfIdentifiedObject instance.
 
Method Summary
abstract  Object delegate()
          Returns the wrapped NetCDF object on which operations are delegated.
 boolean equals(Object other)
          Compares this object with the given object for equality.
 Collection<GenericName> getAlias()
          Returns an empty set, since NetCDF objects don't provide alternative name.
 Citation getAuthority()
          Returns the NETCDF citation.
abstract  String getCode()
          Returns a code which identify this instance.
 String getCodeSpace()
          Returns the "NetCDF" constant, which is used as the code space.
 Set<ReferenceIdentifier> getIdentifiers()
          Returns an empty set, since NetCDF objects don't provide other identifiers than the name.
 ReferenceIdentifier getName()
          Returns the name of this identified object.
 InternationalString getRemarks()
          Returns the NetCDF object description, or null if none.
 String getVersion()
          Returns the version of the NetCDF library.
 int hashCode()
          Returns a hash code value for this object.
 String toString()
          Returns a string representation of this object name.
 String toWKT()
          Returns a Well Known Text representation of this object, if this operation is supported.
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NetcdfIdentifiedObject

protected NetcdfIdentifiedObject()
Creates a new NetcdfIdentifiedObject instance.

Method Detail

delegate

public abstract Object delegate()
Returns the wrapped NetCDF object on which operations are delegated.

Returns:
The wrapped NetCDF object on which operations are delegated.

getAuthority

public Citation getAuthority()
Returns the NETCDF citation.

Specified by:
getAuthority in interface Identifier

getCodeSpace

public String getCodeSpace()
Returns the "NetCDF" constant, which is used as the code space.

Specified by:
getCodeSpace in interface ReferenceIdentifier

getVersion

public String getVersion()
Returns the version of the NetCDF library. The default implementation fetches this information from the META-INF/MANIFEST.MF file in the NetCDF JAR file.

Specified by:
getVersion in interface ReferenceIdentifier

getCode

public abstract String getCode()
Returns a code which identify this instance. This is typically the value returned by the getName() method of the wrapped NetCDF object.

Specified by:
getCode in interface Identifier

getName

public ReferenceIdentifier getName()
Returns the name of this identified object. The default implementation returns this, so subclasses shall returns the name in their implementation of the getCode() method.

Specified by:
getName in interface IdentifiedObject

getAlias

public Collection<GenericName> getAlias()
Returns an empty set, since NetCDF objects don't provide alternative name.

Specified by:
getAlias in interface IdentifiedObject

getIdentifiers

public Set<ReferenceIdentifier> getIdentifiers()
Returns an empty set, since NetCDF objects don't provide other identifiers than the name.

Specified by:
getIdentifiers in interface IdentifiedObject

getRemarks

public InternationalString getRemarks()
Returns the NetCDF object description, or null if none. The default implementation returns null.

Specified by:
getRemarks in interface IdentifiedObject

equals

public boolean equals(Object other)
Compares this object with the given object for equality. The default implementation returns true if the given object is non-null, wraps an object of the same class than this object and the wrapped NetCDF objects are equal.

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

hashCode

public int hashCode()
Returns a hash code value for this object. The default implementation derives a value from the code returned by the wrapped NetCDF object.

Overrides:
hashCode in class Object

toString

public String toString()
Returns a string representation of this object name.

Overrides:
toString in class Object

toWKT

public String toWKT()
             throws UnsupportedOperationException
Returns a Well Known Text representation of this object, if this operation is supported. The default implementation thrown an exception in all cases.

Specified by:
toWKT in interface IdentifiedObject
Throws:
UnsupportedOperationException


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