java.lang.Object
org.apache.jena.graph.impl.LiteralLabel
Represents the "contents" of a Node_Literal.
These contents comprise a lexical form, an optional language tag,
and optional datatype structure and a value.
Create via LiteralLabelFactory which does the checking and adjustments.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Answer true iff this literal is syntactically equal toother
.Answer the datatype of this literal, null if it is untyped.Answer the datatype URI of this literal, null if it untyped.Answer an object used to index this literal.Answer the lexical form of this literal.getValue()
Answer a suitable instance of a Java class representing this literal's value.int
Answer the default hash value, suitable for datatypes which have values which support hashCode() naturally: it is derived from its value if it is well-formed and otherwise from its lexical form.int
hashCode()
Answer the hashcode of this literal, derived from its value if it's well-formed and otherwise its lexical form.Answer the initial text direction associated with this literal (the empty string if there's no text direction).boolean
Answer true iff this is a well-formed literal (the lexical form conforms to the datatype).language()
Answer the language associated with this literal (the empty string if there's no language).boolean
sameValueAs
(LiteralLabel other) Answer true iff this literal represents the same (abstract) value as the other one.toString()
toString
(boolean quoting) toString
(PrefixMapping pmap, boolean quoting)
-
Method Details
-
isWellFormed
public boolean isWellFormed()Answer true iff this is a well-formed literal (the lexical form conforms to the datatype). String literals (xsd:string, rdf:LangString,m rdf:dirLangString) are always well-formed. -
toString
-
toString
-
getLexicalForm
Answer the lexical form of this literal. -
getIndexingValue
Answer an object used to index this literal. This object must provideObject.equals(java.lang.Object)
andObject.hashCode()
based on values, not object instance identity. -
language
Answer the language associated with this literal (the empty string if there's no language). -
initialTextDirection
Answer the initial text direction associated with this literal (the empty string if there's no text direction). -
getValue
Answer a suitable instance of a Java class representing this literal's value. May throw an exception if the literal is ill-formed.- Throws:
DatatypeFormatException
-
getDatatype
Answer the datatype of this literal, null if it is untyped. -
getDatatypeURI
Answer the datatype URI of this literal, null if it untyped. -
equals
Answer true iff this literal is syntactically equal toother
. Note: this is notsameValueAs
. -
sameValueAs
Answer true iff this literal represents the same (abstract) value as the other one. -
hashCode
public int hashCode()Answer the hashcode of this literal, derived from its value if it's well-formed and otherwise its lexical form. -
getValueHashCode
public int getValueHashCode()Answer the default hash value, suitable for datatypes which have values which support hashCode() naturally: it is derived from its value if it is well-formed and otherwise from its lexical form.
-