com.simonstl.moe
Class Name

java.lang.Object
  |
  +--com.simonstl.moe.Name
All Implemented Interfaces:
java.lang.Cloneable, NamingI

public class Name
extends java.lang.Object
implements NamingI

The Name class implements the minimum of functionality needed to support XML names for MOE objects.

version 0.01 is the initial release and contains plenty of bogus placeholder functionality.

Version:
0.01 1 September 2001
Author:
Simon St.Laurent

Field Summary
protected  java.lang.String localName
          contains the local name for the component (if any)
protected  java.lang.String nsURI
          contains the namespace URI for the component (if any)
protected  java.lang.String prefix
          contains the namespace prefix for the component (if any).
 
Constructor Summary
Name()
           
 
Method Summary
static java.lang.String[] breakQName(java.lang.String QName)
          Divides a QName into two pieces.
 java.lang.Object clone()
          Clones the name.
 boolean equals(java.lang.Object _name)
           
 java.lang.String getLocalName()
          Returns the local name for the component
 java.lang.String getNsURI()
          Returns the URI reference value for the namespace.
 java.lang.String getPrefix()
          Returns the prefix used to represent the namespace URI reference for this component.
 java.lang.String getQName()
          Returns the Qualified Name (QName) for the component.
 int hashCode()
          The hashCode() method uses nsURI+">"+localName to generate an int.
 void print()
           
 void setLocalName(java.lang.String _localName)
          Accepts a string which will serve as the local name for this component.
 void setNsURI(java.lang.String _nsURI)
          Accepts a URI reference value which is used as the namespace for the component.
 void setPrefix(java.lang.String _prefix)
          Accepts a string which serves as the prefix for this component.
 void setQName(java.lang.String QName)
          Sets the Qualified Name (QName) for the component.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

nsURI

protected java.lang.String nsURI
contains the namespace URI for the component (if any)

localName

protected java.lang.String localName
contains the local name for the component (if any)

prefix

protected java.lang.String prefix
contains the namespace prefix for the component (if any). prefix:localname yields the QName for the component.
Constructor Detail

Name

public Name()
Method Detail

hashCode

public int hashCode()
The hashCode() method uses nsURI+">"+localName to generate an int. If you need something more precise, you'll need to override this.
Specified by:
hashCode in interface NamingI
Overrides:
hashCode in class java.lang.Object

setNsURI

public void setNsURI(java.lang.String _nsURI)
Description copied from interface: NamingI
Accepts a URI reference value which is used as the namespace for the component.
Specified by:
setNsURI in interface NamingI

getNsURI

public java.lang.String getNsURI()
Description copied from interface: NamingI
Returns the URI reference value for the namespace.
Specified by:
getNsURI in interface NamingI

setLocalName

public void setLocalName(java.lang.String _localName)
Description copied from interface: NamingI
Accepts a string which will serve as the local name for this component.
Specified by:
setLocalName in interface NamingI

getLocalName

public java.lang.String getLocalName()
Description copied from interface: NamingI
Returns the local name for the component
Specified by:
getLocalName in interface NamingI

setPrefix

public void setPrefix(java.lang.String _prefix)
Description copied from interface: NamingI
Accepts a string which serves as the prefix for this component.
Specified by:
setPrefix in interface NamingI

getPrefix

public java.lang.String getPrefix()
Description copied from interface: NamingI
Returns the prefix used to represent the namespace URI reference for this component.
Specified by:
getPrefix in interface NamingI

getQName

public java.lang.String getQName()
Returns the Qualified Name (QName) for the component.
Specified by:
getQName in interface NamingI

setQName

public void setQName(java.lang.String QName)
Sets the Qualified Name (QName) for the component. Overrides current local name and prefix, if any.
Specified by:
setQName in interface NamingI

print

public void print()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object _name)
Overrides:
equals in class java.lang.Object

breakQName

public static java.lang.String[] breakQName(java.lang.String QName)
Divides a QName into two pieces.

clone

public java.lang.Object clone()
Clones the name.
Specified by:
clone in interface NamingI
Overrides:
clone in class java.lang.Object