org.openrdf.model
Interface Literal

All Superinterfaces:
Comparable, Serializable, Value
All Known Implementing Classes:
LiteralImpl

public interface Literal
extends Value

An RDF literal consisting of a label (the value) and optionally a language tag or a datatype (but not both).


Method Summary
 boolean equals(Object other)
          Compares a literal object to another object.
 URI getDatatype()
          Gets the datatype for this literal.
 String getLabel()
          Gets the label of this literal.
 String getLanguage()
          Gets the language tag for this literal, normalized to lowercase.
 int hashCode()
          The hash code of a literal is defined as the hash code of its label: label.hashCode().
 
Methods inherited from interface org.openrdf.model.Value
getObjectStatements
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

getLabel

public String getLabel()
Gets the label of this literal.

Returns:
The literal's label.

getLanguage

public String getLanguage()
Gets the language tag for this literal, normalized to lowercase.

Returns:
The language tag for this literal, or null if it doesn't have one.

getDatatype

public URI getDatatype()
Gets the datatype for this literal.

Returns:
The datatype for this literal, or null if it doesn't have one.

equals

public boolean equals(Object other)
Compares a literal object to another object.

Parameters:
other - The object to compare this literal to.
Returns:
true if the other object is an instance of Literal and if their labels, language tags and datatypes are equal.

hashCode

public int hashCode()
The hash code of a literal is defined as the hash code of its label: label.hashCode().

Returns:
A hash code for the literal.


Copyright © 2002-2006 Aduna BV, GNU LGPL License applies.