com.novell.xml.util
Class NamespaceName

java.lang.Object
  extended bycom.novell.xml.util.NamespaceName
All Implemented Interfaces:
Comparable

public class NamespaceName
extends Object
implements Comparable

Class to encapsulate a namespace URI string This caches the URI strings and uses integers internally for quick equality comparisons


Field Summary
static NamespaceName NULL_NAMESPACE
          A convenience constant for the null namespace
static NamespaceName XML_NAMESPACE
          String representing default XML namespace URI
static NamespaceName XMLNS_NAMESPACE
          String representing the xmlns namespace URI
 
Constructor Summary
NamespaceName(String namespaceName)
          Construct a NamespaceName object for the passed URI
 
Method Summary
 int compareTo(Object rhs)
          Compare this object to another object for order
 boolean equals(NamespaceName rhs)
          Does this object equal the passed NamespaceName?
 boolean equals(Object rhs)
          Does this object equal the passed object?
 boolean equals(String rhs)
          Does this object's URI value match the passed string
 String getString()
          Return the string value of this NamespaceName
 int hashCode()
          Return a hash code for this object
 boolean isEmpty()
          Return true if this NamespaceName represents an empty namespace URI.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XML_NAMESPACE

public static final NamespaceName XML_NAMESPACE
String representing default XML namespace URI

See Also:
XML Names

XMLNS_NAMESPACE

public static final NamespaceName XMLNS_NAMESPACE
String representing the xmlns namespace URI

See Also:
DOM Level 2 Core

NULL_NAMESPACE

public static final NamespaceName NULL_NAMESPACE
A convenience constant for the null namespace

Constructor Detail

NamespaceName

public NamespaceName(String namespaceName)
Construct a NamespaceName object for the passed URI

Parameters:
namespaceName - The namespace URI
Method Detail

getString

public String getString()
Return the string value of this NamespaceName

Returns:
The URI value of this NamespaceName

isEmpty

public boolean isEmpty()
Return true if this NamespaceName represents an empty namespace URI.

Returns:
True if this NamespaceName is empty

hashCode

public int hashCode()
Return a hash code for this object

Returns:
The hash code for this object

equals

public boolean equals(Object rhs)
Does this object equal the passed object? This will match another NamespaceName or a string that matches the URI value.

Parameters:
rhs - The object to compare against
Returns:
True if object is equal to URI string value

equals

public boolean equals(NamespaceName rhs)
Does this object equal the passed NamespaceName?

Parameters:
rhs - The NamespaceName to compare against
Returns:
True if object is equal to URI string value

equals

public boolean equals(String rhs)
Does this object's URI value match the passed string

Parameters:
rhs - The URI string to compare against
Returns:
True if object is equal to URI string value

compareTo

public int compareTo(Object rhs)
Compare this object to another object for order

Specified by:
compareTo in interface Comparable
Parameters:
rhs - The object to compare against. This will order NamespaceNames and Strings
Returns:
< 0 if this object comes before rhs object, == 0 if rhs object is equal > 0 if this object comes after rhs object