org.deri.iris.terms.concrete
Class SqName

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

public class SqName
extends Object
implements ISqName

Simple implementation of the ISqName.

$Id$

Version:
$Revision$
Author:
Richard P??ttler (richard dot poettler at deri dot at)

Constructor Summary
SqName(IIri namespace, String name)
          Contructs a sqname.
SqName(String str)
          Constructs a sqname.
SqName(String namespace, String name)
          Contructs a sqname.
 
Method Summary
 int compareTo(ITerm o)
           
 boolean equals(Object obj)
           
 URI getDatatypeIRI()
          Returns the fully qualified identifier for the data type corresponding to this term.
 String getName()
          Returns the name.
 IIri getNamespace()
          Returns the namespace.
 String getValue()
          Return the wrapped type.
 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

SqName

public SqName(String str)
Constructs a sqname. The format of the string must be <namespace>#<name>.

Parameters:
str - the string to parse
Throws:
NullPointerException - if arg is null
IllegalArgumentException - if the string got an invalid format

SqName

public SqName(String namespace,
              String name)
Contructs a sqname.

Parameters:
namespace - for the sqname
name - for the sqname
Throws:
NullPointerException - if namespace or name is null
IllegalArgumentException - if name is an empty stirng

SqName

public SqName(IIri namespace,
              String name)
Contructs a sqname.

Parameters:
namespace - for the sqname
name - for the sqname
Throws:
NullPointerException - if namespace or name is null
IllegalArgumentException - if name is an empty stirng
Method Detail

getNamespace

public IIri getNamespace()
Description copied from interface: ISqName
Returns the namespace.

Specified by:
getNamespace in interface ISqName
Returns:
The namespace.

getName

public String getName()
Description copied from interface: ISqName
Returns the name.

Specified by:
getName in interface ISqName
Returns:
The name.

toString

public String toString()
Overrides:
toString in class Object

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getValue

public String getValue()
Description copied from interface: ISqName
Return the wrapped type.

Specified by:
getValue in interface ISqName
Specified by:
getValue in interface ITerm
Returns:
The term value.

compareTo

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

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.

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.