dke.xml
Class QName

java.lang.Object
  |
  +--dke.xml.QName
All Implemented Interfaces:
java.lang.Comparable

public class QName
extends java.lang.Object
implements java.lang.Comparable

Qualified name objects

Version:
1.0
Author:
Martin Bernauer

Field Summary
private  java.lang.String _localName
          localname for qulified object
private  java.lang.String _namespaceURI
          namespace for qualified object
 
Constructor Summary
QName(java.lang.String namespaceURI, java.lang.String localName)
          Constructor to create QName (qualified name) objects
 
Method Summary
 int compareTo(java.lang.Object obj)
          Compares this QName with Object obj.
 boolean equals(QName q)
          compares this Object with q
 boolean featuresNamespaceURI()
          check if namespaceURI variable is set
 java.lang.String getLocalName()
          get QName localname
 java.lang.String getNamespaceURI()
          get QName namespace
 java.lang.String toString()
          generates String representation of QName in following syntax
"{" namespaceURI "}" localname
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

_namespaceURI

private java.lang.String _namespaceURI
namespace for qualified object

_localName

private java.lang.String _localName
localname for qulified object
Constructor Detail

QName

public QName(java.lang.String namespaceURI,
             java.lang.String localName)
Constructor to create QName (qualified name) objects
Parameters:
namespaceURI -  
localName -  
Method Detail

featuresNamespaceURI

public boolean featuresNamespaceURI()
check if namespaceURI variable is set
Returns:
true is namespaceURI ist set, false otherwise

getNamespaceURI

public java.lang.String getNamespaceURI()
get QName namespace
Returns:
NamespaceURI

getLocalName

public java.lang.String getLocalName()
get QName localname
Returns:
localname

equals

public boolean equals(QName q)
compares this Object with q
Parameters:
q - object with is to be compared
Returns:
true is equal, false otherwise

toString

public java.lang.String toString()
generates String representation of QName in following syntax
"{" namespaceURI "}" localname
Overrides:
toString in class java.lang.Object
Returns:
String representation of QName

compareTo

public int compareTo(java.lang.Object obj)
              throws java.lang.ClassCastException
Compares this QName with Object obj.

If Object is a instance of QName, this method behaves like String.compareTo(String). Otherwise, it throws a ClassCastException (as QName are comparable only to other QName).

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
obj - Object to which this QName is to be compared.
Throws:
java.lang.ClassCastException - obj is not QName