|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.nsdl.mptstore.rdf.Literal
public class Literal
An RDF literal. A literal has a lexical component and optionally has either a language tag or a datatype (indicated by URIReference).
Constructor Summary | |
---|---|
Literal(java.lang.String value)
Construct a plain literal without a language tag. |
|
Literal(java.lang.String value,
java.lang.String language)
Construct a plain literal with a language tag. |
|
Literal(java.lang.String value,
URIReference datatype)
Construct a typed literal. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
Tell whether this Node should be considered equivalent
to the given object. |
URIReference |
getDatatype()
Get the datatype, if any. |
java.lang.String |
getLanguage()
Get the language tag, if any. |
java.lang.String |
getValue()
Get the lexical value of the node. |
int |
hashCode()
Return a hash code for this node. |
java.lang.String |
toString()
Get an N-Triples string representing this node. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Literal(java.lang.String value)
value
- The lexical value.public Literal(java.lang.String value, java.lang.String language) throws java.text.ParseException
value
- The lexical value.language
- The language tag.
java.text.ParseException
- if the language tag is syntactically invalid.NTriplesUtil.validateLanguage(String)
public Literal(java.lang.String value, URIReference datatype)
value
- The lexical value.datatype
- The datatype.Method Detail |
---|
public java.lang.String getLanguage()
null
if none.public URIReference getDatatype()
null
if none.public java.lang.String getValue()
The lexical value of a URIReference
node is the URI
as a string.
The lexical value of a Literal
node is a string
representation of the value, and does not include the language or
data type, if any.
getValue
in interface Node
null
.public java.lang.String toString()
For URIReference
nodes, this is <$uri>.
For Literal nodes, this is one of the following:
Note:
toString
in interface Node
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
Node
should be considered equivalent
to the given object.
A URIReference
node is equal to the given
object if all of the following conditions are met:
obj != null
obj instanceof URIReference
obj.getURI().equals(this.getURI())
A Literal
node is equal to the given
object if all of the following conditions are met:
obj != null
obj instanceof Literal
obj.getValue().equals(this.getValue())
equals
in interface Node
equals
in class java.lang.Object
obj
- the object to compare to this one.
public int hashCode()
The hash code of a URIReference is the hash code of getURI(). The hash code of a Literal is the hash code of getValue().
hashCode
in interface Node
hashCode
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |