| java.lang.Object com.hp.hpl.jena.enhanced.Polymorphic com.hp.hpl.jena.enhanced.EnhNode
All known Subclasses: com.hp.hpl.jena.rdf.model.impl.LiteralImpl, com.hp.hpl.jena.enhanced.test.TestCommonImpl, com.hp.hpl.jena.rdf.model.impl.ResourceImpl,
EnhNode | public class EnhNode extends Polymorphic implements FrontsNode(Code) | |
A specialisation of Polymorphic that models an extended node in a an extended graph. An extended node
wraps a normal node, and adds additional convenience access or user affordances, though the state
remains in the graph itself.
author: Jeremy Carroll (original code)
author: Chris Dollin (original code)
author: Ian Dickinson (refactoring and commentage) |
Method Summary | |
public RDFNode | as(Class t) | public Node | asNode() | public boolean | canAs(Class t) | protected boolean | canSupport(Class t) answer true iff this enhanced node can support the class t ,
ie it is already a value t or it can be reimplemented
as a t via the graph's personality's implementation.
If this node has no graph, answer false. | protected Polymorphic | convertTo(Class t) Answer an new enhanced node object that presents this in a way
which satisfies type t . | final public boolean | equals(Object o) An enhanced node is equal to another enhanced node n iff the underlying
nodes are equal. | public EnhGraph | getGraph() | protected Personality | getPersonality() Answer the personality object bound to this enhanced node, which we obtain from
the associated enhanced graph. | final public int | hashCode() The hash code of an enhanced node is defined to be the same as the underlying node. | final public boolean | isAnon() An enhanced node is Anon[ymous] iff its underlying node is Blank. | final public boolean | isLiteral() An enhanced node is Literal iff its underlying node is too. | final public boolean | isResource() An enhanced node is a resource if it's node is a URI node or a blank node. | final public boolean | isURIResource() An enhanced node is a URI resource iff its underlying node is too. | public boolean | isValid() | public EnhNode | viewAs(Class t) Answer a facet of this node, where that facet is denoted by the
given type. |
enhGraph | final protected EnhGraph enhGraph(Code) | | The enhanced graph containing this node
|
node | final protected Node node(Code) | | The graph node that this enhanced node is wrapping
|
as | public RDFNode as(Class t)(Code) | | allow subclasses to implement RDFNode & its subinterface
|
asNode | public Node asNode()(Code) | | Answer the graph node that this enhanced node wraps
A plain node |
canAs | public boolean canAs(Class t)(Code) | | API-level method for polymorphic testing
|
canSupport | protected boolean canSupport(Class t)(Code) | | answer true iff this enhanced node can support the class t ,
ie it is already a value t or it can be reimplemented
as a t via the graph's personality's implementation.
If this node has no graph, answer false.
|
convertTo | protected Polymorphic convertTo(Class t)(Code) | | Answer an new enhanced node object that presents this in a way
which satisfies type t . The new object is linked into this
object's sibling ring. If the node cannot be converted, throw an
UnsupportedPolymorphismException.
|
equals | final public boolean equals(Object o)(Code) | | An enhanced node is equal to another enhanced node n iff the underlying
nodes are equal. We generalise to allow the other object to be any class
implementing asNode, because we allow other implemementations of
Resource than EnhNodes, at least in principle.
This is deemed to be a complete and correct interpretation of enhanced node
equality, which is why this method has been marked final.
Parameters: o - An object to test for equality with this node True if o is equal to this node. |
getGraph | public EnhGraph getGraph()(Code) | | Answer the graph containing this node
An enhanced graph |
getPersonality | protected Personality getPersonality()(Code) | | Answer the personality object bound to this enhanced node, which we obtain from
the associated enhanced graph.
The personality object |
hashCode | final public int hashCode()(Code) | | The hash code of an enhanced node is defined to be the same as the underlying node.
The hashcode as an int |
isAnon | final public boolean isAnon()(Code) | | An enhanced node is Anon[ymous] iff its underlying node is Blank.
|
isLiteral | final public boolean isLiteral()(Code) | | An enhanced node is Literal iff its underlying node is too.
|
isResource | final public boolean isResource()(Code) | | An enhanced node is a resource if it's node is a URI node or a blank node.
|
isURIResource | final public boolean isURIResource()(Code) | | An enhanced node is a URI resource iff its underlying node is too.
|
isValid | public boolean isValid()(Code) | | |
viewAs | public EnhNode viewAs(Class t)(Code) | | Answer a facet of this node, where that facet is denoted by the
given type.
Parameters: t - A type denoting the desired facet of the underlying node An enhanced nodet that corresponds to t; this may be thisJava object, or a different object. |
|
|