org.deri.iris.terms.concrete
Class QName

java.lang.Object
  extended by org.deri.iris.terms.concrete.QName
All Implemented Interfaces:
Comparable<ITerm>, IQName, IConcreteTerm, ITerm

public class QName
extends Object
implements IQName

An simple implementation of QName.

Author:
Adrian Marte

Field Summary
 
Fields inherited from interface org.deri.iris.api.terms.concrete.IQName
DATATYPE_URI
 
Constructor Summary
QName(String namespaceName, String localPart)
          Creates a new QName instance for the given namespace name and local part.
 
Method Summary
 int compareTo(ITerm thatObject)
           
 boolean equals(Object obj)
           
 URI getDatatypeIRI()
          Returns the fully qualified identifier for the data type corresponding to this term.
 String getLocalPart()
          Returns the local part of this QName.
 String getNamespaceName()
          Returns the namespace name of this QName.
 String[] getValue()
          Returns an array containing the namespace name (first element) and the local part (second element).
 int hashCode()
           
 boolean isGround()
          Checks whether the term is ground (a term with no variables).
 String toCanonicalString()
          Returns a canonical string representation of this term.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QName

public QName(String namespaceName,
             String localPart)
Creates a new QName instance for the given namespace name and local part.

Parameters:
namespaceName - The namespace name for this QName. May be null.
localPart - The local part of this QName.
Throws:
NullPointerException - If the local part is null.
Method Detail

getNamespaceName

public String getNamespaceName()
Description copied from interface: IQName
Returns the namespace name of this QName.

Specified by:
getNamespaceName in interface IQName
Returns:
The namespace name of this QName.

getLocalPart

public String getLocalPart()
Description copied from interface: IQName
Returns the local part of this QName.

Specified by:
getLocalPart in interface IQName
Returns:
The local part of this QName.

getValue

public String[] getValue()
Description copied from interface: IQName
Returns an array containing the namespace name (first element) and the local part (second element).

Specified by:
getValue in interface IQName
Specified by:
getValue in interface ITerm
Returns:
An array containing the namespace name (first element) and the local part (second element).

getDatatypeIRI

public URI getDatatypeIRI()
Description copied from interface: IConcreteTerm
Returns the fully qualified identifier for the data type corresponding to this term. For instance, a terms representing a double data type should return the URI "http://www.w3.org/2001/XMLSchema#double".

Specified by:
getDatatypeIRI in interface IConcreteTerm
Returns:
The fully qualified identifier for the data type corresponding to this term.

toCanonicalString

public String toCanonicalString()
Description copied from interface: IConcreteTerm
Returns a canonical string representation of this term.

Specified by:
toCanonicalString in interface IConcreteTerm
Returns:
A canonical string representation of this term.

toString

public String toString()
Overrides:
toString in class Object

isGround

public boolean isGround()
Description copied from interface: ITerm
Checks whether the term is ground (a term with no variables).

Specified by:
isGround in interface ITerm
Returns:
true if the term is ground, otherwise false.

compareTo

public int compareTo(ITerm thatObject)
Specified by:
compareTo in interface Comparable<ITerm>

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object