com.hp.hpl.jena.graph
Class Node_Literal

java.lang.Object
  extended by com.hp.hpl.jena.graph.Node
      extended by com.hp.hpl.jena.graph.Node_Concrete
          extended by com.hp.hpl.jena.graph.Node_Literal

public class Node_Literal
extends Node_Concrete

An RDF node holding a literal value. Literals may have datatypes.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.hp.hpl.jena.graph.Node
Node.NotLiteral
 
Field Summary
 
Fields inherited from class com.hp.hpl.jena.graph.Node
ANY, NULL
 
Method Summary
 boolean equals(Object other)
          Nodes only equal other Nodes that have equal labels.
 Object getIndexingValue()
          Literal nodes defer their indexing value to the component literal.
 com.hp.hpl.jena.graph.impl.LiteralLabel getLiteral()
          Answer the literal value of a literal node, or throw an UnsupportedOperationException if it's not a literal node
 RDFDatatype getLiteralDatatype()
          Answer the RDF datatype object of this node's literal value, if it is a literal; otherwise die horribly.
 String getLiteralDatatypeURI()
          Answer the data-type URI of this node's literal value, if it is a literal; otherwise die horribly.
 boolean getLiteralIsXML()
           
 String getLiteralLanguage()
          Answer the language of this node's literal value, if it is a literal; otherwise die horribly.
 String getLiteralLexicalForm()
          Answer the lexical form of this node's literal value, if it is a literal; otherwise die horribly.
 Object getLiteralValue()
          Answer the value of this node's literal value, if it is a literal; otherwise die horribly.
 boolean isLiteral()
          Answer true iff this node is a literal node [subclasses override]
 boolean matches(Node x)
          Answer true iff this node accepts the other one as a match.
 boolean sameValueAs(Object o)
          Test that two nodes are semantically equivalent.
 String toString(PrefixMapping pm, boolean quoting)
          Answer a human readable representation of this Node, quoting literals if specified, and compressing URIs using the prefix mapping supplied.
 Object visitWith(NodeVisitor v)
          Visit a Node and dispatch on it to the appropriate method from the NodeVisitor v.
 
Methods inherited from class com.hp.hpl.jena.graph.Node_Concrete
isConcrete
 
Methods inherited from class com.hp.hpl.jena.graph.Node
create, createAnon, createAnon, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createUncachedLiteral, createUncachedLiteral, createURI, createVariable, getBlankNodeId, getBlankNodeLabel, getLocalName, getName, getNameSpace, getType, getURI, hashCode, hasURI, isBlank, isURI, isVariable, toString, toString, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getLiteral

public com.hp.hpl.jena.graph.impl.LiteralLabel getLiteral()
Description copied from class: Node
Answer the literal value of a literal node, or throw an UnsupportedOperationException if it's not a literal node

Overrides:
getLiteral in class Node

getLiteralValue

public final Object getLiteralValue()
Description copied from class: Node
Answer the value of this node's literal value, if it is a literal; otherwise die horribly.

Overrides:
getLiteralValue in class Node

getLiteralLexicalForm

public final String getLiteralLexicalForm()
Description copied from class: Node
Answer the lexical form of this node's literal value, if it is a literal; otherwise die horribly.

Overrides:
getLiteralLexicalForm in class Node

getLiteralLanguage

public final String getLiteralLanguage()
Description copied from class: Node
Answer the language of this node's literal value, if it is a literal; otherwise die horribly.

Overrides:
getLiteralLanguage in class Node

getLiteralDatatypeURI

public final String getLiteralDatatypeURI()
Description copied from class: Node
Answer the data-type URI of this node's literal value, if it is a literal; otherwise die horribly.

Overrides:
getLiteralDatatypeURI in class Node

getLiteralDatatype

public final RDFDatatype getLiteralDatatype()
Description copied from class: Node
Answer the RDF datatype object of this node's literal value, if it is a literal; otherwise die horribly.

Overrides:
getLiteralDatatype in class Node

getLiteralIsXML

public final boolean getLiteralIsXML()
Overrides:
getLiteralIsXML in class Node

toString

public String toString(PrefixMapping pm,
                       boolean quoting)
Description copied from class: Node
Answer a human readable representation of this Node, quoting literals if specified, and compressing URIs using the prefix mapping supplied.

Overrides:
toString in class Node

isLiteral

public boolean isLiteral()
Description copied from class: Node
Answer true iff this node is a literal node [subclasses override]

Overrides:
isLiteral in class Node

getIndexingValue

public Object getIndexingValue()
Literal nodes defer their indexing value to the component literal.

Overrides:
getIndexingValue in class Node
See Also:
Node.getIndexingValue()

visitWith

public Object visitWith(NodeVisitor v)
Description copied from class: Node
Visit a Node and dispatch on it to the appropriate method from the NodeVisitor v.

Specified by:
visitWith in class Node
Parameters:
v - the visitor to apply to the node
Returns:
the value returned by the applied method

equals

public boolean equals(Object other)
Description copied from class: Node
Nodes only equal other Nodes that have equal labels.

Specified by:
equals in class Node

sameValueAs

public boolean sameValueAs(Object o)
Test that two nodes are semantically equivalent. In some cases this may be the sames as equals, in others equals is stricter. For example, two xsd:int literals with the same value but different language tag are semantically equivalent but distinguished by the java equality function in order to support round tripping.

Default implementation is to use equals, subclasses should override this.

Overrides:
sameValueAs in class Node

matches

public boolean matches(Node x)
Description copied from class: Node
Answer true iff this node accepts the other one as a match. The default is an equality test; it is over-ridden in subclasses to provide the appropriate semantics for literals, ANY, and variables.

Overrides:
matches in class Node
Parameters:
x - a node to test for matching
Returns:
true iff this node accepts the other as a match


Licenced under the Apache License, Version 2.0