| java.lang.Object com.hp.hpl.jena.graph.impl.LiteralLabel
LiteralLabel | final public class LiteralLabel (Code) | | Represents the "contents" of a Node_Literal.
These contents comprise a lexical form, an optional language tag,
and optional datatype structure and a value.
author: Jeremy Carroll and Dave Reynolds |
Constructor Summary | |
public | LiteralLabel(String lex, String lang) Build a plain literal label from its lexical form. | public | LiteralLabel(Object value, String lang, RDFDatatype dtype) Build a typed literal label from its value form. | public | LiteralLabel(String lex, Object value, String lang, RDFDatatype dtype) Build a typed literal label supplying both value and lexical form.
The caller guarantees that the lexical form is legal,
and the value corresponds. | public | LiteralLabel(Object value) Build a typed literal label from its value form using
whatever datatype is currently registered as the the default
representation for this java class. | public | LiteralLabel(String s, String lg, boolean xml) Old style constructor. |
Method Summary | |
public static LiteralLabel | createLiteralLabel(String lex, String lang, RDFDatatype dtype) | public boolean | equals(Object other) Answer true iff this literal is syntactically equal to other . | public RDFDatatype | getDatatype() Answer the datatype of this literal, null if it is untyped. | public String | getDatatypeURI() Answer the datatype URI of this literal, null if it untyped. | public int | getDefaultHashcode() 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. | public Object | getIndexingValue() | public String | getLexicalForm() Answer the lexical form of this literal, constructing it on-the-fly
(and remembering it) if necessary. | public Object | getValue() Answer a suitable instance of a Java class representing this literal's
value. | public int | hashCode() Answer the hashcode of this literal, derived from its value if it's
well-formed and otherwise its lexical form. | public boolean | isWellFormed() Answer truee iff this is a well-formed literal. | public boolean | isXML() Answer true iff this is a well-formed XML literal. | public String | language() Answer the language associated with this literal (the empty string if
there's no language). | protected void | normalize() Normalize the literal. | public boolean | sameValueAs(LiteralLabel other) Answer true iff this literal represents the same (abstract) value as
the other one. | public String | toString(boolean quoting) Answer a human-acceptable representation of this literal value.
This is NOT intended for a machine-processed result. | public String | toString() |
LiteralLabel | public LiteralLabel(String lex, String lang)(Code) | | Build a plain literal label from its lexical form.
Parameters: lex - the lexical form of the literal Parameters: lang - the optional language tag, only relevant for plain literals |
LiteralLabel | public LiteralLabel(Object value, String lang, RDFDatatype dtype) throws DatatypeFormatException(Code) | | Build a typed literal label from its value form. If the value is a string we
assume this is inteded to be a lexical form after all.
Parameters: value - the value of the literal Parameters: lang - the optional language tag, only relevant for plain literals Parameters: dtype - the type of the literal, null for old style "plain" literals |
LiteralLabel | public LiteralLabel(String lex, Object value, String lang, RDFDatatype dtype)(Code) | | Build a typed literal label supplying both value and lexical form.
The caller guarantees that the lexical form is legal,
and the value corresponds.
Parameters: lex - the lexical form of the literal Parameters: value - the value of the literal Parameters: lang - the optional language tag, only relevant for plain literals Parameters: dtype - the type of the literal, null for old style "plain" literals |
LiteralLabel | public LiteralLabel(Object value)(Code) | | Build a typed literal label from its value form using
whatever datatype is currently registered as the the default
representation for this java class. No language tag is supplied.
Parameters: value - the literal value to encapsulate |
LiteralLabel | public LiteralLabel(String s, String lg, boolean xml)(Code) | | Old style constructor. Creates either a plain literal or an
XMLLiteral.
Parameters: xml - If true then s is exclusive canonical XML of type rdf:XMLLiteral, and no checking will be invoked. |
equals | public boolean equals(Object other)(Code) | | Answer true iff this literal is syntactically equal to other .
Note: this is not sameValueAs .
|
getDatatype | public RDFDatatype getDatatype()(Code) | | Answer the datatype of this literal, null if it is untyped.
|
getDatatypeURI | public String getDatatypeURI()(Code) | | Answer the datatype URI of this literal, null if it untyped.
|
getDefaultHashcode | public int getDefaultHashcode()(Code) | | 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.
|
getIndexingValue | public Object getIndexingValue()(Code) | | Answer the value used to index this literal
TODO Consider pushing indexing decisions down to the datatype
|
getLexicalForm | public String getLexicalForm()(Code) | | Answer the lexical form of this literal, constructing it on-the-fly
(and remembering it) if necessary.
|
getValue | public Object getValue() throws DatatypeFormatException(Code) | | Answer a suitable instance of a Java class representing this literal's
value. May throw an exception if the literal is ill-formed.
|
hashCode | public int hashCode()(Code) | | Answer the hashcode of this literal, derived from its value if it's
well-formed and otherwise its lexical form.
|
isWellFormed | public boolean isWellFormed()(Code) | | Answer truee iff this is a well-formed literal.
|
isXML | public boolean isXML()(Code) | | Answer true iff this is a well-formed XML literal.
|
language | public String language()(Code) | | Answer the language associated with this literal (the empty string if
there's no language).
|
normalize | protected void normalize()(Code) | | Normalize the literal. If the value is narrower than the current data type
(e.g. value is xsd:date but the time is xsd:datetime) it will narrow
the type. If the type is narrower than the value then it may normalize
the value (e.g. set the mask of an XSDDateTime)
|
sameValueAs | public boolean sameValueAs(LiteralLabel other)(Code) | | Answer true iff this literal represents the same (abstract) value as
the other one.
|
toString | public String toString(boolean quoting)(Code) | | Answer a human-acceptable representation of this literal value.
This is NOT intended for a machine-processed result.
|
|
|