org.geotools.util
Class GenericName

java.lang.Object
  extended byorg.geotools.util.GenericName
All Implemented Interfaces:
java.lang.Comparable, org.opengis.util.GenericName, java.io.Serializable
Direct Known Subclasses:
LocalName, ScopedName

public abstract class GenericName
extends java.lang.Object
implements org.opengis.util.GenericName, java.io.Serializable

Base class for generic scoped and local name structure for type and attribute name in the context of name spaces.

Note: this class has a natural ordering that is inconsistent with equals. The natural ordering may be case-insensitive and ignore the character separator between name elements.

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

Field Summary
static char DEFAULT_SEPARATOR
          The default separator character.
 
Constructor Summary
protected GenericName()
          Creates a new instance of generic name.
 
Method Summary
 int compareTo(java.lang.Object object)
          Compares this name with the specified object for order.
 boolean equals(java.lang.Object object)
          Compares this generic name with the specified object for equality.
abstract  java.util.List getParsedNames()
          Returns the sequence of local names making this generic name.
abstract  org.opengis.util.GenericName getScope()
          Returns the scope (name space) of this generic name.
 int hashCode()
          Returns a hash code value for this generic name.
 org.opengis.util.InternationalString toInternationalString()
          Returns a local-dependent string representation of this generic name.
 java.lang.String toString()
          Returns a string representation of this generic name.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.opengis.util.GenericName
asLocalName, asScopedName
 

Field Detail

DEFAULT_SEPARATOR

public static final char DEFAULT_SEPARATOR
The default separator character.

See Also:
Constant Field Values
Constructor Detail

GenericName

protected GenericName()
Creates a new instance of generic name.

Method Detail

getScope

public abstract org.opengis.util.GenericName getScope()
Returns the scope (name space) of this generic name. If this name has no scope (e.g. is the root), then this method returns .

Specified by:
getScope in interface org.opengis.util.GenericName

getParsedNames

public abstract java.util.List getParsedNames()
Returns the sequence of local names making this generic name. Each element in this list is like a directory name in a file path name. The length of this sequence is the generic name depth.

Specified by:
getParsedNames in interface org.opengis.util.GenericName

toString

public java.lang.String toString()
Returns a string representation of this generic name. This string representation is local-independant. It contains all elements listed by getParsedNames() separated by an arbitrary character (usually or ). This rule implies that the method for a scoped name will contains the scope, while the method for the local version of the same name will not contains the scope.

Specified by:
toString in interface org.opengis.util.GenericName

toInternationalString

public org.opengis.util.InternationalString toInternationalString()
Returns a local-dependent string representation of this generic name. This string is similar to the one returned by toString() except that each element has been localized in the specified locale. If no international string is available, then this method should returns an implementation mapping to toString() for all locales.

Specified by:
toInternationalString in interface org.opengis.util.GenericName

compareTo

public int compareTo(java.lang.Object object)
Compares this name with the specified object for order. Returns a negative integer, zero, or a positive integer as this name lexicographically precedes, is equals to, or follows the specified object. The comparaison is performed in the following order:

Specified by:
compareTo in interface java.lang.Comparable

equals

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


hashCode

public int hashCode()
Returns a hash code value for this generic name.



Copyright © GeoTools. All Rights Reserved.