|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uk.ac.manchester.cs.owl.owlapi.OWLObjectImpl uk.ac.manchester.cs.owl.owlapi.OWLLiteralImpl
public class OWLLiteralImpl
Author: Matthew Horridge
The University Of Manchester
Bio-Health Informatics Group
Date: 26-Oct-2006
Constructor Summary | |
---|---|
OWLLiteralImpl(OWLDataFactory dataFactory,
java.lang.String literal,
OWLDatatype datatype)
|
|
OWLLiteralImpl(OWLDataFactory dataFactory,
java.lang.String literal,
java.lang.String lang)
|
Method Summary | ||
---|---|---|
void |
accept(OWLAnnotationValueVisitor visitor)
|
|
|
accept(OWLAnnotationValueVisitorEx<O> visitor)
|
|
void |
accept(OWLDataVisitor visitor)
|
|
|
accept(OWLDataVisitorEx<O> visitor)
|
|
void |
accept(OWLObjectVisitor visitor)
|
|
|
accept(OWLObjectVisitorEx<O> visitor)
|
|
protected int |
compareObjectOfSameType(OWLObject object)
|
|
boolean |
equals(java.lang.Object obj)
|
|
OWLDatatype |
getDatatype()
Gets the OWLDatatype which types this literal. |
|
java.lang.String |
getLang()
Gets the language tag of this literal. |
|
java.lang.String |
getLiteral()
Gets the lexical value of this literal. |
|
boolean |
hasLang()
Determines if this literal has a language tag. |
|
boolean |
hasLang(java.lang.String lang)
Determines if this OWLLiteral has a particular language tag. |
|
boolean |
isBoolean()
Determines if this literal is typed with a datatype that has an IRI that is "http://www.w3.org/2001/XMLSchema#"boolean . |
|
boolean |
isDouble()
Determines if this literal is typed with a datatype that has an IRI that is "http://www.w3.org/2001/XMLSchema#"double . |
|
boolean |
isFloat()
Determines if this literal is typed with a datatype that has an IRI that is "http://www.w3.org/2001/XMLSchema#"float . |
|
boolean |
isInteger()
Determines if this literal is typed with a datatype that has an IRI that is "http://www.w3.org/2001/XMLSchema#"integer . |
|
boolean |
isRDFPlainLiteral()
Determines if the datatype of this literal is rdf:PlainLiteral . |
|
boolean |
parseBoolean()
Parses the lexical value of this literal into a boolean. |
|
double |
parseDouble()
Parses the lexical value of this literal into a double. |
|
float |
parseFloat()
Parses the lexical value of this literal into a float. |
|
int |
parseInteger()
Parses the lexical value of this literal into an integer. |
Methods inherited from class uk.ac.manchester.cs.owl.owlapi.OWLObjectImpl |
---|
compareSets, compareTo, getClassesInSignature, getDataPropertiesInSignature, getDatatypesInSignature, getIndividualsInSignature, getNestedClassExpressions, getObjectPropertiesInSignature, getOWLDataFactory, getSignature, hashCode, isBottomEntity, isTopEntity, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public OWLLiteralImpl(OWLDataFactory dataFactory, java.lang.String literal, OWLDatatype datatype)
public OWLLiteralImpl(OWLDataFactory dataFactory, java.lang.String literal, java.lang.String lang)
Method Detail |
---|
public java.lang.String getLiteral()
OWLLiteral
rdf:PlainLiteral
then the
abbreviated lexical form will be returned. That is, the language tag is not included.
getLiteral
in interface OWLLiteral
rdf:PlainLiteral
then the return
values are as follows: If the literal is of the form "abc@"^^rdf:PlainLiteral
then the return value
will be "abc" (without the language tag included). If the literal is of the form
"abc@langTag"^^rdf:PlainLiteral
then the return value will be "abc" (without the language tag included).public boolean isRDFPlainLiteral()
OWLLiteral
rdf:PlainLiteral
. Note that literals that are
abbreviated in the functional syntax (and other concrete syntaxes) and are of the form "abc"
or "abc"@langTag
will be of the type rdf:PlainLiteral
after parsing.
isRDFPlainLiteral
in interface OWLLiteral
true
if the datatype of this literal is rdf:PlainLiteral, otherwise false
.public boolean hasLang()
OWLLiteral
hasLang
in interface OWLLiteral
true
if this literal has a non-empty language tag, otherwise false
public boolean isInteger()
OWLLiteral
"http://www.w3.org/2001/XMLSchema#"integer
.
isInteger
in interface OWLLiteral
true
if this literal is typed with "http://www.w3.org/2001/XMLSchema#"integer
,
i.e. this literal represents an integer, otherwise false
.public int parseInteger() throws java.lang.NumberFormatException
OWLLiteral
"http://www.w3.org/2001/XMLSchema#"integer
)
parseInteger
in interface OWLLiteral
java.lang.NumberFormatException
- if the lexical form could not be parsed into an integer because it is not in
the lexical space of the integer datatype.public boolean isBoolean()
OWLLiteral
"http://www.w3.org/2001/XMLSchema#"boolean
.
isBoolean
in interface OWLLiteral
true
if this literal is typed with "http://www.w3.org/2001/XMLSchema#"boolean
,
i.e. this literal represents a boolean, otherwise false
.public boolean parseBoolean() throws java.lang.NumberFormatException
OWLLiteral
"http://www.w3.org/2001/XMLSchema#"boolean
).
parseBoolean
in interface OWLLiteral
java.lang.NumberFormatException
- if the lexical form could not be parsed into a boolean because it is not in
the lexical space of the boolean datatype.public boolean isDouble()
OWLLiteral
"http://www.w3.org/2001/XMLSchema#"double
.
isDouble
in interface OWLLiteral
true
if this literal is typed with "http://www.w3.org/2001/XMLSchema#"double
,
i.e. this literal represents a double, otherwise false
.public double parseDouble() throws java.lang.NumberFormatException
OWLLiteral
"http://www.w3.org/2001/XMLSchema#"double
).
parseDouble
in interface OWLLiteral
java.lang.NumberFormatException
- if the lexical form could not be parsed into a double because it is not in
the lexical space of the double datatype.public boolean isFloat()
OWLLiteral
"http://www.w3.org/2001/XMLSchema#"float
.
isFloat
in interface OWLLiteral
true
if this literal is typed with "http://www.w3.org/2001/XMLSchema#"float
,
i.e. this literal represents a float, otherwise false
.public float parseFloat() throws java.lang.NumberFormatException
OWLLiteral
"http://www.w3.org/2001/XMLSchema#"float
).
parseFloat
in interface OWLLiteral
java.lang.NumberFormatException
- if the lexical form could not be parsed into a float because it is not in
the lexical space of the float datatype.public java.lang.String getLang()
OWLLiteral
getLang
in interface OWLLiteral
rdf:PlainLiteral
, or because its language tag is empty, then the empty string
will be returned. (The null
value is never returned).public boolean hasLang(java.lang.String lang)
OWLLiteral
OWLLiteral
has a particular language tag.
hasLang
in interface OWLLiteral
lang
- The specific lang to test for. The tag will be normalised - white space will be trimmed from
the end and it will be converted to lower case.
true
if this literal has a language tag equal to lang
, otherwise
false
.public OWLDatatype getDatatype()
OWLLiteral
OWLDatatype
which types this literal.
getDatatype
in interface OWLLiteral
OWLDatatype
that types this literal. Note that for strings with language tag (previously
considered to be untyped literals) the datatype will be rdf:PlainLiteral. The return value is
never null
.public boolean equals(java.lang.Object obj)
equals
in class OWLObjectImpl
public void accept(OWLDataVisitor visitor)
accept
in interface OWLLiteral
public <O> O accept(OWLDataVisitorEx<O> visitor)
accept
in interface OWLLiteral
public void accept(OWLAnnotationValueVisitor visitor)
accept
in interface OWLAnnotationValue
public <O> O accept(OWLAnnotationValueVisitorEx<O> visitor)
accept
in interface OWLAnnotationValue
protected int compareObjectOfSameType(OWLObject object)
compareObjectOfSameType
in class OWLObjectImpl
public void accept(OWLObjectVisitor visitor)
accept
in interface OWLObject
public <O> O accept(OWLObjectVisitorEx<O> visitor)
accept
in interface OWLObject
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |