org.geotoolkit.naming
Class AbstractName

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

Deprecated. Moved to the org.apache.sis.util.iso package.

@Deprecated
public abstract class AbstractName
extends Object
implements GenericName, Serializable

A sequence of identifiers rooted within the context of a namespace. Names are immutable. They may be fully qualified like "org.opengis.util.Record", or they may be relative to a scope like "util.Record" in the "org.opengis" scope. See GenericName javadoc for an illustration.

Subclasses need only to implement the following methods:

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:
3.00
Author:
Martin Desruisseaux (Geomatys)
See Also:
Serialized Form
Module:
metadata/geotk-metadata (download)    View source code for this class

Constructor Summary
protected AbstractName()
          Deprecated. Creates a new instance of generic name.
 
Method Summary
 int compareTo(GenericName name)
          Deprecated. Compares this name with the specified name for order.
 int depth()
          Deprecated. Indicates the number of levels specified by this name.
 boolean equals(Object object)
          Deprecated. Compares this generic name with the specified object for equality.
abstract  List<? extends LocalName> getParsedNames()
          Deprecated. Returns the sequence of local names making this generic name.
 int hashCode()
          Deprecated. Returns a hash code value for this generic name.
 LocalName head()
          Deprecated. Returns the first element in the sequence of parsed names.
 ScopedName push(GenericName scope)
          Deprecated. Returns this name expanded with the specified scope.
abstract  NameSpace scope()
          Deprecated. Returns the scope (name space) in which this name is local.
 LocalName tip()
          Deprecated. Returns the last element in the sequence of parsed names.
 GenericName toFullyQualifiedName()
          Deprecated. Returns a view of this name as a fully-qualified name.
 InternationalString toInternationalString()
          Deprecated. Returns a local-dependent string representation of this generic name.
 String toString()
          Deprecated. Returns a string representation of this generic name.
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractName

protected AbstractName()
Deprecated. 
Creates a new instance of generic name.

Method Detail

scope

public abstract NameSpace scope()
Deprecated. 
Returns the scope (name space) in which this name is local. For example if a fully qualified name is "org.opengis.util.Record" and if this instance is the "util.Record" part, then its scope is named "org.opengis".

Continuing with the above example, the full "org.opengis.util.Record" name has no scope. If this method is invoked on such name, then the Geotk implementation returns a global scope instance (i.e. an instance for which NameSpace.isGlobal() returns true) which is unique and named "global".

Specified by:
scope in interface GenericName

depth

public int depth()
Deprecated. 
Indicates the number of levels specified by this name. The default implementation returns the size of the list returned by the getParsedNames() method.

Specified by:
depth in interface GenericName

getParsedNames

public abstract List<? extends LocalName> getParsedNames()
Deprecated. 
Returns the sequence of local names making this generic name. The length of this sequence is the depth. It does not include the scope.

Specified by:
getParsedNames in interface GenericName

head

public LocalName head()
Deprecated. 
Returns the first element in the sequence of parsed names. For any LocalName, this is always this.

Example: If this name is "org.opengis.util.Record" (no matter its scope), then this method returns "org".

Specified by:
head in interface GenericName

tip

public LocalName tip()
Deprecated. 
Returns the last element in the sequence of parsed names. For any LocalName, this is always this.

Example: If this name is "org.opengis.util.Record" (no matter its scope), then this method returns "Record".

Specified by:
tip in interface GenericName

toFullyQualifiedName

public GenericName toFullyQualifiedName()
Deprecated. 
Returns a view of this name as a fully-qualified name. The scope of a fully qualified name is global. If the scope of this name is already global, then this method returns this.

Specified by:
toFullyQualifiedName in interface GenericName

push

public ScopedName push(GenericName scope)
Deprecated. 
Returns this name expanded with the specified scope. One may represent this operation as a concatenation of the specified scope with this. For example if this name is "util.Record" and the given scope argument is "org.opengis", then this.push(scope) shall returns "org.opengis.util.Record".

Specified by:
push in interface GenericName

toString

public String toString()
Deprecated. 
Returns a string representation of this generic name. This string representation is local-independent. It contains all elements listed by getParsedNames() separated by a namespace-dependent character (usually : or /). This rule implies that the result may or may not be fully qualified. Special cases:

Specified by:
toString in interface GenericName
Overrides:
toString in class Object

toInternationalString

public InternationalString toInternationalString()
Deprecated. 
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 returns an implementation mapping to toString() for all locales.

Specified by:
toInternationalString in interface GenericName

compareTo

public int compareTo(GenericName name)
Deprecated. 
Compares this name with the specified name for order. Returns a negative integer, zero, or a positive integer as this name lexicographically precedes, is equal to, or follows the specified name. The comparison is performed in the following way:

Specified by:
compareTo in interface Comparable<GenericName>
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)
Deprecated. 
Compares this generic name with the specified object for equality. The default implementation returns true if the scopes and the lists of parsed names are equal.

Overrides:
equals in class Object
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()
Deprecated. 
Returns a hash code value for this generic name.

Overrides:
hashCode in class Object


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