org.geotoolkit.naming
Class DefaultScopedName

Object
  extended by AbstractName
      extended by DefaultScopedName
All Implemented Interfaces:
Serializable, Comparable<GenericName>, GenericName, ScopedName

@Immutable
public class DefaultScopedName
extends AbstractName
implements ScopedName

A composite of a name space (as a local name) and a generic name valid in that name space. See the GeoAPI javadoc for more information.

DefaultScopedName 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 DefaultScopedName(GenericName path, GenericName tail)
          Constructs a scoped name as the concatenation of the given generic names.
protected DefaultScopedName(NameSpace scope, List<? extends CharSequence> names)
          Constructs a scoped name from the specified list of strings.
 
Method Summary
 List<? extends LocalName> getParsedNames()
          Returns the sequence of local name for this generic name.
 GenericName path()
          Returns every element of the parsed names list except for the tip.
 NameSpace scope()
          Returns the scope (name space) in which this name is local.
 GenericName tail()
          Returns every elements of the parsed names list except for the head.
 
Methods inherited from class AbstractName
compareTo, depth, equals, hashCode, head, push, tip, toFullyQualifiedName, toInternationalString, toString
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ScopedName
head, tip, toString
 
Methods inherited from interface GenericName
depth, push, toFullyQualifiedName, toInternationalString
 
Methods inherited from interface Comparable
compareTo
 

Constructor Detail

DefaultScopedName

protected DefaultScopedName(NameSpace scope,
                            List<? extends CharSequence> names)
Constructs a scoped name from the specified list of strings. If any of the given names 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 the global scope.
names - The local names. This list must have at least two elements.

DefaultScopedName

protected DefaultScopedName(GenericName path,
                            GenericName tail)
Constructs a scoped name as the concatenation of the given generic names. The scope of the new name will be the scope of the path argument.

Parameters:
path - The first part to concatenate.
tail - The second part to concatenate.
Method Detail

scope

public NameSpace scope()
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
Specified by:
scope in class AbstractName

tail

public GenericName tail()
Returns every elements of the parsed names list except for the head.

Specified by:
tail in interface ScopedName

path

public GenericName path()
Returns every element of the parsed names list except for the tip.

Specified by:
path in interface ScopedName

getParsedNames

public List<? extends LocalName> getParsedNames()
Returns the sequence of local name for this generic name.

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


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