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, isURIResource, isValid, viewAs
addView, supports
as, canAs, isAnon, isLiteral, isResource, isURIResource
asNode
public static final Implementation factory
public Object visitWith(RDFVisitor rv)
RDFNode
public Literal inModel(Model m)
public Literal asLiteral()
RDFNode
public Resource asResource()
RDFNode
asResource
in interface RDFNode
public Model getModel()
public String toString()
RDFNode
public Object getValue()
public RDFDatatype getDatatype()
getDatatype
in interface Literal
public String getDatatypeURI()
getDatatypeURI
in interface Literal
public String getLexicalForm()
getLexicalForm
in interface Literal
public boolean getBoolean()
Literal
getBoolean
in interface Literal
public byte getByte()
Literal
public short getShort()
Literal
public int getInt()
Literal
public long getLong()
Literal
public char getChar()
Literal
public float getFloat()
Literal
public double getDouble()
Literal
public String getString()
Literal
public String getLanguage()
Literal
getLanguage
in interface Literal
public boolean isWellFormedXML()
Literal
isWellFormedXML
in interface Literal
public boolean sameValueAs(Literal other)
sameValueAs
in interface Literal
Licenced under the Apache License, Version 2.0