com.clarkparsia.pellet.datatypes
Class InfiniteNamedDatatype

java.lang.Object
  extended by com.clarkparsia.pellet.datatypes.InfiniteNamedDatatype
All Implemented Interfaces:
Datatype<aterm.ATermAppl>

public class InfiniteNamedDatatype
extends java.lang.Object
implements Datatype<aterm.ATermAppl>

Title: Infinite Named Datatype

Description: Infinite named datatype, which permits all strings as lexical forms and for which identity and equality of the value space match equality of the lexical space.

Copyright: Copyright (c) 2009

Company: Clark & Parsia, LLC.

Author:
Mike Smith

Method Summary
 RestrictedDatatype<aterm.ATermAppl> asDataRange()
          Get the canonical data range for a datatype
 boolean equals(java.lang.Object obj)
           
static InfiniteNamedDatatype get(aterm.ATermAppl dtName)
          Get an instance with a specific name.
 aterm.ATermAppl getCanonicalRepresentation(aterm.ATermAppl input)
          Get the canonical representation of a lexical form
 aterm.ATermAppl getLiteral(java.lang.Object value)
          Get the canonical ATermAppl literal representation for a value space object.
 aterm.ATermAppl getName()
          Get the datatype identifier
 Datatype<?> getPrimitiveDatatype()
          Get the primitive datatype associated with this datatype.
 aterm.ATermAppl getValue(aterm.ATermAppl literal)
          Get the Java object representation of a data value
 int hashCode()
           
 boolean isPrimitive()
          Check if a datatype is primitive.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

get

public static InfiniteNamedDatatype get(aterm.ATermAppl dtName)
Get an instance with a specific name.

Parameters:
dtName - the name of the datatype
Returns:
an instance

asDataRange

public RestrictedDatatype<aterm.ATermAppl> asDataRange()
Description copied from interface: Datatype
Get the canonical data range for a datatype

Specified by:
asDataRange in interface Datatype<aterm.ATermAppl>
Returns:
a DataRange representation of the datatype value space

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

getCanonicalRepresentation

public aterm.ATermAppl getCanonicalRepresentation(aterm.ATermAppl input)
                                           throws InvalidLiteralException
Description copied from interface: Datatype
Get the canonical representation of a lexical form

Specified by:
getCanonicalRepresentation in interface Datatype<aterm.ATermAppl>
Parameters:
input - a lexical form of the literal
Returns:
the canonical representation of the lexical form
Throws:
InvalidLiteralException

getLiteral

public aterm.ATermAppl getLiteral(java.lang.Object value)
Description copied from interface: Datatype
Get the canonical ATermAppl literal representation for a value space object. This may be unsupported by datatypes for which Datatype.isPrimitive() returns false.

Specified by:
getLiteral in interface Datatype<aterm.ATermAppl>
Parameters:
value - Element of the value space for some datatype
Returns:
The ATermAppl representation of value

getName

public aterm.ATermAppl getName()
Description copied from interface: Datatype
Get the datatype identifier

Specified by:
getName in interface Datatype<aterm.ATermAppl>
Returns:
ATermAppl of URI for datatype

getPrimitiveDatatype

public Datatype<?> getPrimitiveDatatype()
Description copied from interface: Datatype
Get the primitive datatype associated with this datatype.

Specified by:
getPrimitiveDatatype in interface Datatype<aterm.ATermAppl>
Returns:
this if isPrimitive() == true, else a primitive datatype that is a superset of the value space of this datatype.

getValue

public aterm.ATermAppl getValue(aterm.ATermAppl literal)
                         throws InvalidLiteralException
Description copied from interface: Datatype
Get the Java object representation of a data value

Specified by:
getValue in interface Datatype<aterm.ATermAppl>
Parameters:
literal - the literal
Returns:
the Java object representation of the lexical form
Throws:
InvalidLiteralException

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

isPrimitive

public boolean isPrimitive()
Description copied from interface: Datatype
Check if a datatype is primitive. All datatypes are either primitive or derived. Derived datatypes are names for subsets of the value spaces of primitive datatypes, defined using specific constraining facet values.

Specified by:
isPrimitive in interface Datatype<aterm.ATermAppl>
Returns:
true if the datatype is primitive, false else

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2004 Evren Sirin. All Rights Reserved.