com.simonstl.common
Class Name

java.lang.Object
  |
  +--com.simonstl.common.Name
All Implemented Interfaces:
NamingI
Direct Known Subclasses:
NamedComponent

public class Name
extends java.lang.Object
implements NamingI

Created by IntelliJ IDEA. User: simon Date: Mar 8, 2003 Time: 11:33:28 AM To change this template use Options | File Templates.


Field Summary
protected  java.lang.String localName
           
protected  java.lang.String nsURI
           
protected  java.lang.String prefix
           
 
Constructor Summary
Name()
           
 
Method Summary
static java.lang.String[] breakQName(java.lang.String QName)
          Divides a QName into two pieces.
 boolean equals(java.lang.Object _name)
          The equals method only compares Namespace URI and Local Name to determine equality.
 java.lang.String getLocalName()
          Returns the local name for the component
 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.
 java.lang.String getUri()
          Returns the URI reference value for the namespace.
 int hashCode()
          The hashCode() method uses namespaceURI+">"+localName to generate an int.
 void setLocalName(java.lang.String newLocalName)
          Accepts a string which will serve as the local name for this component.
 void setPrefix(java.lang.String newPrefix)
          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.
 void setUri(java.lang.String newNsURI)
          Accepts a URI reference value which is used as the namespace for the component.
static int toHashCode(java.lang.String URI, java.lang.String name)
          The toHashCode() method uses namespaceURI+">"+localName to generate an int.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nsURI

protected java.lang.String nsURI

localName

protected java.lang.String localName

prefix

protected java.lang.String prefix
Constructor Detail

Name

public Name()
Method Detail

hashCode

public int hashCode()
The hashCode() method uses namespaceURI+">"+localName to generate an int. If you need something more precise, you'll need to override this. Note that namespace prefixes are not used in the hashCode generation process.

Specified by:
hashCode in interface NamingI
Overrides:
hashCode in class java.lang.Object

setUri

public void setUri(java.lang.String newNsURI)
Accepts a URI reference value which is used as the namespace for the component.

Specified by:
setUri in interface NamingI

getUri

public java.lang.String getUri()
Returns the URI reference value for the namespace.

Specified by:
getUri in interface NamingI

setLocalName

public void setLocalName(java.lang.String newLocalName)
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()
Returns the local name for the component

Specified by:
getLocalName in interface NamingI

setPrefix

public void setPrefix(java.lang.String newPrefix)
Accepts a string which serves as the prefix for this component.

Specified by:
setPrefix in interface NamingI

getPrefix

public java.lang.String getPrefix()
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. Doesn't make any changes to the namespace URI!

Specified by:
setQName in interface NamingI

equals

public boolean equals(java.lang.Object _name)
The equals method only compares Namespace URI and Local Name to determine equality. This is not not necessarily transitive.

Specified by:
equals in interface NamingI
Overrides:
equals in class java.lang.Object

breakQName

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


toHashCode

public static int toHashCode(java.lang.String URI,
                             java.lang.String name)
The toHashCode() method uses namespaceURI+">"+localName to generate an int. If you need something more precise, you'll need to override this. Note that namespace prefixes are not used in the hashCode generation process.