gate.creole.ontology
Class DataType

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

public class DataType
extends Object

This class provides a list of datatypes, supported by the ontology API.

Author:
Niraj Aswani

Field Summary
protected  String xmlSchemaURIString
          for each datatype, there exists a XML Schema URI in ontology which is used to denote the specific datatype.
 
Constructor Summary
DataType(OURI xmlSchemaURI)
          Constructor
DataType(String xmlSchemaURIString)
           
 
Method Summary
 boolean equals(Object o)
          Compares if the two objects are same, i.e. if their string representations are identical.
static DataType getBooleanDataType()
          denotes the "http://www.w3.org/2001/XMLSchema#boolean" datatype.
static DataType getByteDataType()
          denotes the "http://www.w3.org/2001/XMLSchema#byte" datatype.
static DataType getDataType(String datatypeURI)
          Gets the respective datatype for the given datatype URI.
static DataType getDateDataType()
          denotes the "http://www.w3.org/2001/XMLSchema#date" datatype.
static DataType getDateTimeDataType()
          denotes the "http://www.w3.org/2001/XMLSchema#dateTime" datatype.
static DataType getDecimalDataType()
          denotes the "http://www.w3.org/2001/XMLSchema#decimal" datatype.
static DataType getDoubleDataType()
          denotes the "http://www.w3.org/2001/XMLSchema#double" datatype.
static DataType getDurationDataType()
          denotes the "http://www.w3.org/2001/XMLSchema#duration" datatype.
static DataType getFloatDataType()
          denotes the "http://www.w3.org/2001/XMLSchema#float" datatype.
static DataType getIntDataType()
          denotes the "http://www.w3.org/2001/XMLSchema#int" datatype.
static DataType getIntegerDataType()
          denotes the "http://www.w3.org/2001/XMLSchema#integer" datatype.
static Locale getLocale(String languageCode)
          Gets the respective locale for the given 2 character language code.
static DataType getLongDataType()
          denotes the "http://www.w3.org/2001/XMLSchema#long" datatype.
static DataType getNegativeIntegerDataType()
          denotes the "http://www.w3.org/2001/XMLSchema#negativeInteger" datatype.
static DataType getNonNegativeIntegerDataType()
          denotes the "http://www.w3.org/2001/XMLSchema#nonNegativeInteger" datatype.
static DataType getNonPositiveIntegerDataType()
          denotes the "http://www.w3.org/2001/XMLSchema#nonPositiveInteger" datatype.
static DataType getPositiveIntegerDataType()
          denotes the "http://www.w3.org/2001/XMLSchema#positiveInteger" datatype.
static DataType getShortDataType()
          denotes the "http://www.w3.org/2001/XMLSchema#short" datatype.
static DataType getStringDataType()
          denotes the "http://www.w3.org/2001/XMLSchema#string" datatype.
static DataType getTimeDataType()
          denotes the "http://www.w3.org/2001/XMLSchema#time" datatype.
static DataType getUnsignedByteDataType()
          denotes the "http://www.w3.org/2001/XMLSchema#unsignedByte" datatype.
static DataType getUnsignedIntDataType()
          denotes the "http://www.w3.org/2001/XMLSchema#unsignedInt" datatype.
static DataType getUnsignedLongDataType()
          denotes the "http://www.w3.org/2001/XMLSchema#unsignedLong" datatype.
static DataType getUnsignedShortDataType()
          denotes the "http://www.w3.org/2001/XMLSchema#unsignedShort" datatype.
 OURI getXmlSchemaURI()
          Deprecated. 
 String getXmlSchemaURIString()
           
 int hashCode()
           
 boolean isStringDataType()
           
 boolean isValidValue(String value)
          Checks whether the provided value is a valid value for the datatype (e.g. if the datatype is integer, parsing a string value into integer causes the exception or not.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xmlSchemaURIString

protected String xmlSchemaURIString
for each datatype, there exists a XML Schema URI in ontology which is used to denote the specific datatype. For example to denote the boolean datatype one would have to use "http://www.w3.org/2001/XMLSchema#boolean".

Constructor Detail

DataType

public DataType(OURI xmlSchemaURI)
Constructor

Parameters:
xmlSchemaURI - for each datatype, there exists a XML Schema URI in ontology which is used to denote the specific datatype. For example to denote the boolean datatype one would have to use "http://www.w3.org/2001/XMLSchema#boolean".

DataType

public DataType(String xmlSchemaURIString)
Method Detail

isStringDataType

public boolean isStringDataType()

getBooleanDataType

public static DataType getBooleanDataType()
denotes the "http://www.w3.org/2001/XMLSchema#boolean" datatype.


getByteDataType

public static DataType getByteDataType()
denotes the "http://www.w3.org/2001/XMLSchema#byte" datatype.


getDateDataType

public static DataType getDateDataType()
denotes the "http://www.w3.org/2001/XMLSchema#date" datatype.


getDecimalDataType

public static DataType getDecimalDataType()
denotes the "http://www.w3.org/2001/XMLSchema#decimal" datatype.


getDoubleDataType

public static DataType getDoubleDataType()
denotes the "http://www.w3.org/2001/XMLSchema#double" datatype.


getDurationDataType

public static DataType getDurationDataType()
denotes the "http://www.w3.org/2001/XMLSchema#duration" datatype.


getFloatDataType

public static DataType getFloatDataType()
denotes the "http://www.w3.org/2001/XMLSchema#float" datatype.


getIntDataType

public static DataType getIntDataType()
denotes the "http://www.w3.org/2001/XMLSchema#int" datatype.


getIntegerDataType

public static DataType getIntegerDataType()
denotes the "http://www.w3.org/2001/XMLSchema#integer" datatype.


getLongDataType

public static DataType getLongDataType()
denotes the "http://www.w3.org/2001/XMLSchema#long" datatype.


getNegativeIntegerDataType

public static DataType getNegativeIntegerDataType()
denotes the "http://www.w3.org/2001/XMLSchema#negativeInteger" datatype.


getNonNegativeIntegerDataType

public static DataType getNonNegativeIntegerDataType()
denotes the "http://www.w3.org/2001/XMLSchema#nonNegativeInteger" datatype.


getNonPositiveIntegerDataType

public static DataType getNonPositiveIntegerDataType()
denotes the "http://www.w3.org/2001/XMLSchema#nonPositiveInteger" datatype.


getPositiveIntegerDataType

public static DataType getPositiveIntegerDataType()
denotes the "http://www.w3.org/2001/XMLSchema#positiveInteger" datatype.


getShortDataType

public static DataType getShortDataType()
denotes the "http://www.w3.org/2001/XMLSchema#short" datatype.


getStringDataType

public static DataType getStringDataType()
denotes the "http://www.w3.org/2001/XMLSchema#string" datatype.


getTimeDataType

public static DataType getTimeDataType()
denotes the "http://www.w3.org/2001/XMLSchema#time" datatype.


getDateTimeDataType

public static DataType getDateTimeDataType()
denotes the "http://www.w3.org/2001/XMLSchema#dateTime" datatype.


getUnsignedByteDataType

public static DataType getUnsignedByteDataType()
denotes the "http://www.w3.org/2001/XMLSchema#unsignedByte" datatype.


getUnsignedIntDataType

public static DataType getUnsignedIntDataType()
denotes the "http://www.w3.org/2001/XMLSchema#unsignedInt" datatype.


getUnsignedLongDataType

public static DataType getUnsignedLongDataType()
denotes the "http://www.w3.org/2001/XMLSchema#unsignedLong" datatype.


getUnsignedShortDataType

public static DataType getUnsignedShortDataType()
denotes the "http://www.w3.org/2001/XMLSchema#unsignedShort" datatype.


getXmlSchemaURI

@Deprecated
public OURI getXmlSchemaURI()
Deprecated. 


getXmlSchemaURIString

public String getXmlSchemaURIString()

equals

public boolean equals(Object o)
Compares if the two objects are same, i.e. if their string representations are identical.

Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

isValidValue

public boolean isValidValue(String value)
Checks whether the provided value is a valid value for the datatype (e.g. if the datatype is integer, parsing a string value into integer causes the exception or not.

Parameters:
value -
Returns:
true, if the provided value can be parsed correctly into the datatype, otherwise - false.

getDataType

public static DataType getDataType(String datatypeURI)
Gets the respective datatype for the given datatype URI. If the URI is invalid, the method returns null.


getLocale

public static Locale getLocale(String languageCode)
Gets the respective locale for the given 2 character language code. If the code doesn't match, the method returns null.