org.geotoolkit.naming
Class DefaultLocalName

Object
  extended by AbstractName
      extended by DefaultLocalName
All Implemented Interfaces:
Serializable, Comparable<GenericName>, GenericName, LocalName
Direct Known Subclasses:
DefaultMemberName, DefaultTypeName

@Immutable
public class DefaultLocalName
extends AbstractName
implements LocalName

Identifier within a name space for a local object. Local names are names which are directly accessible to and maintained by a name space. Names are local to one and only one name space. The name space within which they are local is indicated by the scope.

DefaultLocalName can be instantiated by any of the following methods:

Since:
2.1
Version:
3.00
Author:
Martin Desruisseaux (Geomatys)
See Also:
Serialized Form
Module:
metadata/geotk-metadata (download)    View source code for this class

Constructor Summary
protected DefaultLocalName(NameSpace scope, CharSequence name)
          Constructs a local name from the given character sequence.
 
Method Summary
 int compareTo(GenericName name)
          Compares this name with the specified object for order.
 int depth()
          Returns the depth, which is always 1 for a local name.
 boolean equals(Object object)
          Compares this local name with the specified object for equality.
 List<DefaultLocalName> getParsedNames()
          Returns the sequence of local name for this generic name.
 int hashCode()
          Returns a hash code value for this local name.
 LocalName head()
          Returns this since this object is already a local name.
 NameSpace scope()
          Returns the scope (name space) in which this name is local.
 LocalName tip()
          Returns this since this object is already a local name.
 InternationalString toInternationalString()
          Returns a local-dependent string representation of this locale name.
 String toString()
          Returns a locale-independent string representation of this local name.
 
Methods inherited from class AbstractName
push, toFullyQualifiedName
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface GenericName
push, toFullyQualifiedName
 

Constructor Detail

DefaultLocalName

protected DefaultLocalName(NameSpace scope,
                           CharSequence name)
Constructs a local name from the given character sequence. If the character sequence is an instance of InternationalString, then its toString(null) method will be invoked for fetching an unlocalized name. Otherwise the toString() method will be used.

Parameters:
scope - The scope of this name, or null for a global scope.
name - The local name (never null).
Method Detail

scope

public NameSpace scope()
Returns the scope (name space) in which this name is local. This method returns a non-null value in all cases, even when the scope given to the constructor was null.

Specified by:
scope in interface GenericName
Specified by:
scope in class AbstractName

depth

public final int depth()
Returns the depth, which is always 1 for a local name.

Specified by:
depth in interface GenericName
Specified by:
depth in interface LocalName
Overrides:
depth in class AbstractName

getParsedNames

public final List<DefaultLocalName> getParsedNames()
Returns the sequence of local name for this generic name. Since this object is itself a locale name, this method always returns a singleton containing only this.

Specified by:
getParsedNames in interface GenericName
Specified by:
getParsedNames in interface LocalName
Specified by:
getParsedNames in class AbstractName

head

public final LocalName head()
Returns this since this object is already a local name.

Specified by:
head in interface GenericName
Specified by:
head in interface LocalName
Overrides:
head in class AbstractName

tip

public final LocalName tip()
Returns this since this object is already a local name.

Specified by:
tip in interface GenericName
Specified by:
tip in interface LocalName
Overrides:
tip in class AbstractName

toString

public String toString()
Returns a locale-independent string representation of this local name. This string does not include the scope, which is consistent with the parsed names definition.

Specified by:
toString in interface GenericName
Specified by:
toString in interface LocalName
Overrides:
toString in class AbstractName

toInternationalString

public InternationalString toInternationalString()
Returns a local-dependent string representation of this locale name.

Specified by:
toInternationalString in interface GenericName
Overrides:
toInternationalString in class AbstractName

compareTo

public int compareTo(GenericName name)
Compares this name with the specified object for order. Returns a negative integer, zero, or a positive integer as this name lexicographically precedes, is equal to, or follows the specified object. The comparison is case-insensitive.

Specified by:
compareTo in interface Comparable<GenericName>
Overrides:
compareTo in class AbstractName
Parameters:
name - The other name to compare with this name.
Returns:
-1 if this name precedes the given one, +1 if it follows, 0 if equals.

equals

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

Overrides:
equals in class AbstractName
Parameters:
object - The object to compare with this name for equality.
Returns:
true if the given object is equal to this name.

hashCode

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

Overrides:
hashCode in class AbstractName


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