org.opengis.example.util
Class SimpleNameSpace

Show UML class diagram
Object
  extended by SimpleNameSpace
All Implemented Interfaces:
Serializable, NameSpace

public class SimpleNameSpace
extends Object
implements NameSpace, Serializable

A NameSpace defining the scope of SimpleName instances.

See Also:
Serialized Form

Field Summary
protected  SimpleNameFactory factory
          The factory to use for creating name instances in this namespace.
 
Constructor Summary
SimpleNameSpace(SimpleNameSpace parent, Name name)
          Creates a new instance for the given parent namespace and name.
SimpleNameSpace(SimpleNameSpace parent, String name)
          Creates a new instance for the given parent namespace and name.
 
Method Summary
 boolean equals(Object other)
          Compares the given object to this namespace for equality.
 int hashCode()
          Returns a hash code value for this namespace.
 boolean isGlobal()
          Indicates whether this namespace is a "top level" namespace.
 GenericName name()
          Represents the identifier of this namespace.
 String toString()
          Returns a string representation of this namespace.
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

factory

protected final SimpleNameFactory factory
The factory to use for creating name instances in this namespace.

Constructor Detail

SimpleNameSpace

public SimpleNameSpace(SimpleNameSpace parent,
                       String name)
                throws InvalidNameException
Creates a new instance for the given parent namespace and name. The new instance will share the factory instance from its parent, unless parent is null in which case the default factory will be used.

Parameters:
parent - The parent of the new namespace, or null if none.
name - The identifier of this namespace.
Throws:
InvalidNameException - If the given name violates the JNDI syntax.

SimpleNameSpace

public SimpleNameSpace(SimpleNameSpace parent,
                       Name name)
                throws InvalidNameException
Creates a new instance for the given parent namespace and name. The new instance will share the factory instance from its parent, unless parent is null in which case the default factory will be used.

Parameters:
parent - The parent of the new namespace, or null if none.
name - The identifier of this namespace.
Throws:
InvalidNameException - If the given name violates the JNDI syntax.
Method Detail

isGlobal

public boolean isGlobal()
Indicates whether this namespace is a "top level" namespace. Global, or top-level namespaces are not contained within another namespace. The global namespace has no parent.

Specified by:
isGlobal in interface NameSpace
Returns:
true if this namespace has no parent.

name

public GenericName name()
Represents the identifier of this namespace. Namespace identifiers shall be fully-qualified names where:
name.scope().isGlobal() == true

Specified by:
name in interface NameSpace
Returns:
The identifier of this namespace.

toString

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

Overrides:
toString in class Object
Returns:
A string representation of this name.

equals

public boolean equals(Object other)
Compares the given object to this namespace for equality.

Overrides:
equals in class Object
Parameters:
other - The other object to compare to this namespace.

hashCode

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

Overrides:
hashCode in class Object


Copyright © 1994-2013 Open Geospatial Consortium. All Rights Reserved.