public class OWLLiteralImpl extends OWLObjectImplWithoutEntityAndAnonCaching implements OWLLiteral
OWLLiteral that uses compression of strings. See
also OWLLiteralImplNoCompression| Constructor and Description |
|---|
OWLLiteralImpl(String literal,
String lang,
OWLDatatype datatype) |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(OWLAnnotationValueVisitor visitor) |
<O> O |
accept(OWLAnnotationValueVisitorEx<O> visitor) |
void |
accept(OWLDataVisitor visitor) |
<O> O |
accept(OWLDataVisitorEx<O> visitor) |
void |
accept(OWLObjectVisitor visitor)
Accepts a visitor
|
<O> O |
accept(OWLObjectVisitorEx<O> visitor)
Accepts a visitor
|
void |
addAnonymousIndividualsToSet(Set<OWLAnonymousIndividual> anons) |
void |
addSignatureEntitiesToSet(Set<OWLEntity> entities) |
com.google.common.base.Optional<OWLAnonymousIndividual> |
asAnonymousIndividual() |
com.google.common.base.Optional<IRI> |
asIRI() |
com.google.common.base.Optional<OWLLiteral> |
asLiteral() |
boolean |
equals(Object obj) |
OWLDatatype |
getDatatype()
Gets the
OWLDatatype which types this literal. |
String |
getLang()
Gets the language tag of this literal.
|
String |
getLiteral()
Gets the lexical value of this literal.
|
int |
hashCode() |
boolean |
hasLang()
Determines if this literal has a language tag.
|
boolean |
hasLang(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.
|
compareTo, containsEntityInSignature, getAnnotationPropertiesInSignature, getAnonymousIndividuals, getClassesInSignature, getDataPropertiesInSignature, getDatatypesInSignature, getIndividualsInSignature, getNestedClassExpressions, getObjectPropertiesInSignature, getSignature, isBottomEntity, isTopEntity, toStringgetNestedClassExpressions, isBottomEntity, isTopEntity, toStringcompareTogetSignaturecontainsEntityInSignaturegetAnonymousIndividualsgetClassesInSignaturegetObjectPropertiesInSignaturegetDataPropertiesInSignaturegetIndividualsInSignaturegetDatatypesInSignaturegetAnnotationPropertiesInSignaturepublic OWLLiteralImpl(@Nonnull String literal, @Nullable String lang, @Nullable OWLDatatype datatype)
literal - the lexical formlang - the language; can be null or an empty string, in which case
datatype can be any datatype but not nulldatatype - the datatype; if lang is null or the empty string, it can be null
or it MUST be RDFPlainLiteralpublic void addSignatureEntitiesToSet(Set<OWLEntity> entities)
addSignatureEntitiesToSet in interface HasIncrementalSignatureGenerationSupportentities - entity set where entities will be addedpublic void addAnonymousIndividualsToSet(Set<OWLAnonymousIndividual> anons)
addAnonymousIndividualsToSet in interface HasIncrementalSignatureGenerationSupportanons - anonymous individuals set where individuals will be addedpublic String getLiteral()
OWLLiteralrdf:PlainLiteral then the abbreviated lexical form will be
returned. That is, the language tag is not included.getLiteral in interface OWLLiteralrdf: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()
OWLLiteralrdf: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 OWLLiteraltrue if the datatype of this literal is rdf:PlainLiteral,
otherwise false.public boolean hasLang()
OWLLiteralhasLang in interface OWLLiteraltrue if this literal has a non-empty language tag,
otherwise falsepublic boolean isInteger()
OWLLiteral"http://www.w3.org/2001/XMLSchema#"integer.isInteger in interface OWLLiteraltrue 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()
OWLLiteral"http://www.w3.org/2001/XMLSchema#"integer)parseInteger in interface OWLLiteralpublic boolean isBoolean()
OWLLiteral"http://www.w3.org/2001/XMLSchema#"boolean.isBoolean in interface OWLLiteraltrue 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()
OWLLiteral"http://www.w3.org/2001/XMLSchema#"boolean).parseBoolean in interface OWLLiteralpublic boolean isDouble()
OWLLiteral"http://www.w3.org/2001/XMLSchema#"double.isDouble in interface OWLLiteraltrue 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()
OWLLiteral"http://www.w3.org/2001/XMLSchema#"double).parseDouble in interface OWLLiteralpublic boolean isFloat()
OWLLiteral"http://www.w3.org/2001/XMLSchema#"float.isFloat in interface OWLLiteraltrue 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()
OWLLiteral"http://www.w3.org/2001/XMLSchema#"float).parseFloat in interface OWLLiteralpublic String getLang()
OWLLiteralgetLang in interface HasLanggetLang in interface OWLLiteralrdf:PlainLiteral, or because its language tag is empty,
then the empty string will be returned. (The null value
is never returned).public boolean hasLang(String lang)
OWLLiteralOWLLiteral has a particular language tag.hasLang in interface OWLLiterallang - 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()
OWLLiteralOWLDatatype which types this literal.getDatatype in interface OWLLiteralOWLDatatype 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 int hashCode()
hashCode in class OWLObjectImplWithoutEntityAndAnonCachingpublic boolean equals(Object obj)
equals in class OWLObjectImplWithoutEntityAndAnonCachingpublic void accept(OWLDataVisitor visitor)
accept in interface OWLLiteralvisitor - visitorpublic <O> O accept(OWLDataVisitorEx<O> visitor)
accept in interface OWLLiteralO - visitor return typevisitor - visitorpublic void accept(OWLAnnotationValueVisitor visitor)
accept in interface OWLAnnotationValuevisitor - visitor to acceptpublic <O> O accept(OWLAnnotationValueVisitorEx<O> visitor)
accept in interface OWLAnnotationValueO - visitor return typevisitor - visitor to acceptpublic void accept(OWLObjectVisitor visitor)
OWLObjectpublic <O> O accept(OWLObjectVisitorEx<O> visitor)
OWLObjectpublic com.google.common.base.Optional<IRI> asIRI()
asIRI in interface OWLAnnotationValuepublic com.google.common.base.Optional<OWLAnonymousIndividual> asAnonymousIndividual()
asAnonymousIndividual in interface OWLAnnotationValuepublic com.google.common.base.Optional<OWLLiteral> asLiteral()
asLiteral in interface OWLAnnotationValueCopyright © 2016 The University of Manchester. All Rights Reserved.