public class LiteralImpl extends EnhNode implements Literal
| Modifier and Type | Field and Description |
|---|---|
static Implementation |
factory |
| Constructor and Description |
|---|
LiteralImpl(Node n,
EnhGraph m) |
LiteralImpl(Node n,
ModelCom m) |
| Modifier and Type | Method and Description |
|---|---|
Literal |
asLiteral()
If this node is a Literal, answer that literal; otherwise throw an
exception.
|
Resource |
asResource()
If this node is a Resource, answer that resource; otherwise throw an
exception.
|
boolean |
getBoolean()
If the literal is interpretable as a Boolean return its value
as a boolean.
|
byte |
getByte()
If the literal is interpretable as a Byte return its value.
|
char |
getChar()
If the literal is interpretable as a Char return its value.
|
RDFDatatype |
getDatatype()
Return the datatype of the literal.
|
String |
getDatatypeURI()
Return the uri of the datatype of the literal.
|
double |
getDouble()
If the literal is interpretable as a Double return its value.
|
float |
getFloat()
If the literal is interpretable as a Float return its value.
|
int |
getInt()
If the literal is interpretable as a Integer return its value.
|
String |
getLanguage()
If a language is defined for this literal return it
|
String |
getLexicalForm()
Return the lexical form of the literal.
|
long |
getLong()
If the literal is interpretable as a Long return its value.
|
Model |
getModel()
Answer the model this literal was created in, if any, otherwise null.
|
short |
getShort()
If the literal is interpretable as a Short return its value.
|
String |
getString()
If the literal is interpretable as a string return its value.
|
Object |
getValue()
Return the value of the literal.
|
Literal |
inModel(Model m)
Literals are not in any particular model, and so inModel can return this.
|
boolean |
isWellFormedXML()
Answer true iff this literal is (or claims to be) well-formed XML.
|
boolean |
sameValueAs(Literal other)
Test that two literals are semantically equivalent.
|
String |
toString()
Answer a String representation of the node.
|
Object |
visitWith(RDFVisitor rv)
Apply the appropriate method of the visitor to this node's content and
return the result.
|
as, asNode, canAs, equals, getGraph, hashCode, isAnon, isLiteral, isResource, isStmtResource, isURIResource, isValid, viewAsaddView, supportsas, canAs, isAnon, isLiteral, isResource, isStmtResource, isURIResourceasNodepublic static final Implementation factory
public Object visitWith(RDFVisitor rv)
RDFNodepublic Literal inModel(Model m)
public Literal asLiteral()
RDFNodepublic Resource asResource()
RDFNodeasResource in interface RDFNodepublic Model getModel()
public String toString()
RDFNodepublic Object getValue()
public RDFDatatype getDatatype()
getDatatype in interface Literalpublic String getDatatypeURI()
getDatatypeURI in interface Literalpublic String getLexicalForm()
getLexicalForm in interface Literalpublic boolean getBoolean()
LiteralgetBoolean in interface Literalpublic byte getByte()
Literalpublic short getShort()
Literalpublic int getInt()
Literalpublic long getLong()
Literalpublic char getChar()
Literalpublic float getFloat()
Literalpublic double getDouble()
Literalpublic String getString()
Literalpublic String getLanguage()
LiteralgetLanguage in interface Literalpublic boolean isWellFormedXML()
LiteralisWellFormedXML in interface Literalpublic boolean sameValueAs(Literal other)
sameValueAs in interface LiteralLicenced under the Apache License, Version 2.0