org.deri.iris.terms.concrete
Class NormalizedString

java.lang.Object
  extended by org.deri.iris.terms.concrete.NormalizedString
All Implemented Interfaces:
Comparable<ITerm>, INormalizedString, IConcreteTerm, IStringTerm, ITerm
Direct Known Subclasses:
Token

public class NormalizedString
extends Object
implements INormalizedString

A simple implementation of NormalizedString.

Author:
Adrian Marte

Field Summary
protected  String value
           
 
Fields inherited from interface org.deri.iris.api.terms.concrete.INormalizedString
DATATYPE_URI
 
Constructor Summary
NormalizedString(String string)
          Creates a new NormalizedString instance.
 
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 getValue()
          Returns the string representing this xsd:normalizedString.
 int hashCode()
           
 boolean isGround()
          Checks whether the term is ground (a term with no variables).
static String normalize(String string)
           
 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
 

Field Detail

value

protected String value
Constructor Detail

NormalizedString

public NormalizedString(String string)
Creates a new NormalizedString instance. The specified string is normalized if it is not normalized already.

Parameters:
string - The normalized or non-normalized string.
Method Detail

normalize

public static String normalize(String string)

getValue

public String getValue()
Description copied from interface: INormalizedString
Returns the string representing this xsd:normalizedString.

Specified by:
getValue in interface INormalizedString
Specified by:
getValue in interface IStringTerm
Specified by:
getValue in interface ITerm
Returns:
The string representing this xsd:normalizedString.

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 o)
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