org.jrdf.graph
Interface Literal

All Superinterfaces:
Node, ObjectNode, TypedNodeVisitable, Value
All Known Subinterfaces:
LiteralMutableId
All Known Implementing Classes:
AbstractLiteral, LiteralImpl, LiteralImpl

public interface Literal
extends ObjectNode, Value

RDF literal node.

Version:
$Revision: 1804 $
Author:
Simon Raboczi, Andrew Newman

Method Summary
 boolean equals(Object obj)
          Indicates whether some other object is "equal to" this one.
 URI getDatatypeURI()
          Returns the URI of the RDF datatype of this resource, or NULL_URI for an untyped node.
 DatatypeValue getDatatypeValue()
          Obtain the data type representation of this literal.
 String getEscapedForm()
          Provide a legible representation of a literal, following the N-Triples format defined in §3.2 of the W3C's RDF Test Cases Recommendation.
 String getEscapedLexicalForm()
          Returns an escaped lexical form where double quotes and backslashes are escaped.
 String getLanguage()
          Returns the language code of the literal, or "" if no language specified.
 Object getValue()
          Obtain a Java native representation of the datatype.
 int hashCode()
          Returns a hash-code value for this literal.
 boolean isDatatypedLiteral()
          Returns true if the literal is a datatype literal.
 boolean isLanguageLiteral()
          Returns true if the literal is a language literal.
 boolean isPlainLiteral()
          Returns true if the literal is a untyped/plain literal.
 String toString()
          Returns the lexical form.
 
Methods inherited from interface org.jrdf.graph.TypedNodeVisitable
accept
 
Methods inherited from interface org.jrdf.graph.Value
getLexicalForm, isWellFormedXML
 

Method Detail

getValue

Object getValue()
Obtain a Java native representation of the datatype.

Specified by:
getValue in interface Value
Returns:
a Java native representation of the datatype.

getDatatypeValue

DatatypeValue getDatatypeValue()
Obtain the data type representation of this literal.

Returns:
the value object (data type) of this literal.

getLanguage

String getLanguage()
Returns the language code of the literal, or "" if no language specified.

Returns:
the language code of the literal, or "" if no language specified.

getDatatypeURI

URI getDatatypeURI()
Returns the URI of the RDF datatype of this resource, or NULL_URI for an untyped node.

Returns:
the URI of the RDF datatype of this resource, or NULL_URI for an untyped node.

isDatatypedLiteral

boolean isDatatypedLiteral()
Returns true if the literal is a datatype literal.

Returns:
true if the literal is a datatype literal.

isLanguageLiteral

boolean isLanguageLiteral()
Returns true if the literal is a language literal.

Returns:
true if the literal is a language literal.

isPlainLiteral

boolean isPlainLiteral()
Returns true if the literal is a untyped/plain literal.

Returns:
true if the literal is a untyped/plain literal.

equals

boolean equals(Object obj)
Indicates whether some other object is "equal to" this one.

A literal is equal to another literal if:

Overrides:
equals in class Object
Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.

hashCode

int hashCode()
Returns a hash-code value for this literal. The hash code is based upon XORing all of the literal's components hash codes including the lexical form, datatype, and language.

Overrides:
hashCode in class Object
Returns:
a hash-code value for this literal.

getEscapedForm

String getEscapedForm()
Provide a legible representation of a literal, following the N-Triples format defined in §3.2 of the W3C's RDF Test Cases Recommendation.

Well-formed Unicode surrogate pairs in the lexical form are escaped as a single 8-digit hexadecimal \U escape sequence rather than a pair of 4-digit &x5C;u sequences representing 4 the surrogates.

Returns:
this instance in N-Triples format

getEscapedLexicalForm

String getEscapedLexicalForm()
Returns an escaped lexical form where double quotes and backslashes are escaped.

Returns:
String the lexical form.

toString

String toString()
Returns the lexical form.

Overrides:
toString in class Object
Returns:
the lexical form.