gate.creole.ontology
Class Literal

java.lang.Object
  extended by gate.creole.ontology.Literal

public class Literal
extends Object

Literal represents a single value or a value with language used for annotation properties, or a value with datatype used for the datatype properties.

Author:
Niraj Aswani

Constructor Summary
Literal(String value)
          Constructor
Literal(String value, DataType dataType)
          Constructor
Literal(String value, Locale language)
          Constructor
 
Method Summary
 boolean equals(Object obj)
           
 DataType getDataType()
          Gets the assigned datatype.
 Locale getLanguage()
          Returns the language associated with this literal.
 String getValue()
          Returns the value associated with this instance of literal.
 int hashCode()
           
 String toString()
           
 String toTurtle()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Literal

public Literal(String value)
Constructor

Parameters:
value -

Literal

public Literal(String value,
               Locale language)
Constructor

Parameters:
value -
language -

Literal

public Literal(String value,
               DataType dataType)
        throws InvalidValueException
Constructor

Parameters:
value -
dataType -
Throws:
InvalidValueException
Method Detail

getDataType

public DataType getDataType()
Gets the assigned datatype. This may return null if user did not use the Literal(String, Datatype) constructor to instantiate the instance.

Returns:

getValue

public String getValue()
Returns the value associated with this instance of literal.

Returns:

getLanguage

public Locale getLanguage()
Returns the language associated with this literal. This may return null if use did not use the Literal(String, String) constructor to instantiate the instance.

Returns:

toString

public String toString()
Overrides:
toString in class Object

toTurtle

public String toTurtle()

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

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