Package openllet.core.datatypes
Class InfiniteNamedDatatype
- java.lang.Object
-
- openllet.core.datatypes.InfiniteNamedDatatype
-
- All Implemented Interfaces:
Datatype<openllet.aterm.ATermAppl>
public class InfiniteNamedDatatype extends java.lang.Object implements Datatype<openllet.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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RestrictedDatatype<openllet.aterm.ATermAppl>
asDataRange()
Get the canonical _data range for a datatypeboolean
equals(java.lang.Object obj)
static InfiniteNamedDatatype
get(openllet.aterm.ATermAppl dtName)
Get an instance with a specific _name.openllet.aterm.ATermAppl
getCanonicalRepresentation(openllet.aterm.ATermAppl input)
Get the canonical representation of a lexical formopenllet.aterm.ATermAppl
getLiteral(java.lang.Object value)
Get the canonicalATermAppl
literal representation for a value space object.openllet.aterm.ATermAppl
getName()
Get the datatype identifierDatatype<?>
getPrimitiveDatatype()
Get the primitive datatype associated with this datatype.openllet.aterm.ATermAppl
getValue(openllet.aterm.ATermAppl literal)
Get the Java object representation of a _data valueint
hashCode()
boolean
isPrimitive()
Check if a datatype is primitive.java.lang.String
toString()
-
-
-
Method Detail
-
get
public static InfiniteNamedDatatype get(openllet.aterm.ATermAppl dtName)
Get an instance with a specific _name.- Parameters:
dtName
- the _name of the datatype- Returns:
- an instance
-
asDataRange
public RestrictedDatatype<openllet.aterm.ATermAppl> asDataRange()
Description copied from interface:Datatype
Get the canonical _data range for a datatype- Specified by:
asDataRange
in interfaceDatatype<openllet.aterm.ATermAppl>
- Returns:
- a
DataRange
representation of the datatype value space
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
getCanonicalRepresentation
public openllet.aterm.ATermAppl getCanonicalRepresentation(openllet.aterm.ATermAppl input) throws InvalidLiteralException
Description copied from interface:Datatype
Get the canonical representation of a lexical form- Specified by:
getCanonicalRepresentation
in interfaceDatatype<openllet.aterm.ATermAppl>
- Parameters:
input
- a lexical form of the literal- Returns:
- the canonical representation of the lexical form
- Throws:
InvalidLiteralException
- if input is invalid
-
getLiteral
public openllet.aterm.ATermAppl getLiteral(java.lang.Object value)
Description copied from interface:Datatype
Get the canonicalATermAppl
literal representation for a value space object. This may be unsupported by datatypes for whichDatatype.isPrimitive()
returnsfalse
.- Specified by:
getLiteral
in interfaceDatatype<openllet.aterm.ATermAppl>
- Parameters:
value
- Element of the value space for some datatype- Returns:
- The
ATermAppl
representation ofvalue
-
getName
public openllet.aterm.ATermAppl getName()
Description copied from interface:Datatype
Get the datatype identifier
-
getPrimitiveDatatype
public Datatype<?> getPrimitiveDatatype()
Description copied from interface:Datatype
Get the primitive datatype associated with this datatype.- Specified by:
getPrimitiveDatatype
in interfaceDatatype<openllet.aterm.ATermAppl>
- Returns:
this
ifisPrimitive() == true
, else a primitive datatype that is a superset of the value space of this datatype.
-
getValue
public openllet.aterm.ATermAppl getValue(openllet.aterm.ATermAppl literal) throws InvalidLiteralException
Description copied from interface:Datatype
Get the Java object representation of a _data value- Specified by:
getValue
in interfaceDatatype<openllet.aterm.ATermAppl>
- Parameters:
literal
- the literal- Returns:
- the Java object representation of the lexical form
- Throws:
InvalidLiteralException
- if literal is invalid
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.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 interfaceDatatype<openllet.aterm.ATermAppl>
- Returns:
true
if the datatype is primitive,false
else
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-