java.lang.Object
org.apache.jena.enhanced.EnhGraph
- Direct Known Subclasses:
ModelCom
EnhGraph
wraps a plain graph
and contains enhanced nodes
that wrap the
plain nodes of the plain graph. All the enhanced nodes in
the enhanced graph share the same polymorphic personality.-
Constructor Summary
ConstructorsConstructorDescriptionEnhGraph
(Graph g, Personality<RDFNode> p) Construct an enhanced graph from the given underlying graph, and a factory for generating enhanced nodes. -
Method Summary
Modifier and TypeMethodDescriptionasGraph()
Answer the normal graph that this enhanced graph is wrapping.final boolean
An enhanced graph is equal to another graph g iff the underlying graphs are equal.<X extends RDFNode>
XAnswer an enhanced node that wraps the given node and conforms to the given interface type.final int
hashCode()
Hashcode for an enhanced graph is delegated to the underlying graph.final boolean
Answer true if the given enhanced graph contains the same nodes and edges as this graph.void
setNodeCache
(Cache<Node, RDFNode> cc) Deprecated.This is a no-op and the method will be removed.
-
Constructor Details
-
EnhGraph
Construct an enhanced graph from the given underlying graph, and a factory for generating enhanced nodes.- Parameters:
g
- The underlying plain graph, may be null to defer binding to a given graph until later.p
- The personality factory, that maps types to realizations
-
-
Method Details
-
asGraph
Answer the normal graph that this enhanced graph is wrapping.- Returns:
- A graph
-
hashCode
public final int hashCode()Hashcode for an enhanced graph is delegated to the underlying graph. -
equals
An enhanced graph is equal to another graph g iff the underlying graphs are equal. This is deemed to be a complete and correct interpretation of enhanced graph equality, which is why this method has been marked final.Note that this equality test does not look for correspondence between the structures in the two graphs. To test whether another graph has the same nodes and edges as this one, use
isIsomorphicWith(org.apache.jena.enhanced.EnhGraph)
. -
isIsomorphicWith
Answer true if the given enhanced graph contains the same nodes and edges as this graph. The default implementation delegates this to the underlying graph objects.- Parameters:
eg
- A graph to test- Returns:
- True if eg is a graph with the same structure as this.
-
getNodeAs
Answer an enhanced node that wraps the given node and conforms to the given interface type.- Parameters:
n
- A node (assumed to be in this graph)interf
- A type denoting the enhanced facet desired- Returns:
- An enhanced node
-
setNodeCache
Deprecated.This is a no-op and the method will be removed.Set the cache controller object for this graph- Parameters:
cc
- The cache controller
-