java.lang.Object
org.apache.jena.enhanced.Implementation
org.apache.jena.ontapi.common.BaseEnhNodeFactoryImpl
org.apache.jena.ontapi.common.CommonEnhNodeFactoryImpl
- All Implemented Interfaces:
EnhNodeFactory
Default implementation of
EnhNodeFactory
.
This is a kind of constructor that consists of three modules:
EnhNodeProducer
for initialization and physical creation a nodeEnhNode
in the graphEnhGraph
.EnhNodeFilter
to test the presence of a node in the graph.EnhNodeFinder
to search for nodes in the graph.
-
Constructor Summary
ConstructorsConstructorDescriptionCommonEnhNodeFactoryImpl
(EnhNodeProducer maker, EnhNodeFinder finder, EnhNodeFilter filter) -
Method Summary
Modifier and TypeMethodDescriptionboolean
canCreateInGraph
(org.apache.jena.graph.Node node, org.apache.jena.enhanced.EnhGraph eg) Answerstrue
iff the modifying of thegraph
is allowed by this implementation for the encapsulated object's interface.boolean
canWrap
(org.apache.jena.graph.Node node, org.apache.jena.enhanced.EnhGraph eg) Checks that the wrapping (node
,eg
) would succeed.org.apache.jena.enhanced.EnhNode
createInGraph
(org.apache.jena.graph.Node node, org.apache.jena.enhanced.EnhGraph eg) Makes interface-defined changes in the given graph and returns a new enhanced node, wrapping the givenNode
.org.apache.jena.enhanced.EnhNode
createInstance
(org.apache.jena.graph.Node node, org.apache.jena.enhanced.EnhGraph eg) Wraps the given pair ofnode
andgraph
to a freshEnhNode
instance without any checking or throwing any exception.getMaker()
org.apache.jena.util.iterator.ExtendedIterator<org.apache.jena.enhanced.EnhNode>
iterator
(org.apache.jena.enhanced.EnhGraph eg) Returns anExtended Iterator
over thenode
s found in theEnhGraph
in the form ofEnhNode
with the interface that this factory encapsulates.org.apache.jena.enhanced.EnhNode
wrap
(org.apache.jena.graph.Node node, org.apache.jena.enhanced.EnhGraph eg) Creates a newEnhNode
wrapping the givenNode
node in the context of the graphEnhGraph
.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.jena.ontapi.common.EnhNodeFactory
find
-
Constructor Details
-
CommonEnhNodeFactoryImpl
-
-
Method Details
-
getMaker
-
getFinder
-
getFilter
-
wrap
public org.apache.jena.enhanced.EnhNode wrap(org.apache.jena.graph.Node node, org.apache.jena.enhanced.EnhGraph eg) Description copied from class:BaseEnhNodeFactoryImpl
Creates a newEnhNode
wrapping the givenNode
node in the context of the graphEnhGraph
.- Specified by:
wrap
in interfaceEnhNodeFactory
- Overrides:
wrap
in classBaseEnhNodeFactoryImpl
- Parameters:
node
- the node to be wrappedeg
- the graph containing the node- Returns:
- A new enhanced node which wraps node but presents the interface(s) that this factory encapsulates.
-
canWrap
public boolean canWrap(org.apache.jena.graph.Node node, org.apache.jena.enhanced.EnhGraph eg) Description copied from interface:EnhNodeFactory
Checks that the wrapping (node
,eg
) would succeed.- Specified by:
canWrap
in interfaceEnhNodeFactory
- Specified by:
canWrap
in classorg.apache.jena.enhanced.Implementation
- Parameters:
node
- node the node to test for suitabilityeg
- the enhanced graph the node appears in- Returns:
true
iff thenode
can represent the type in the graph
-
createInGraph
public org.apache.jena.enhanced.EnhNode createInGraph(org.apache.jena.graph.Node node, org.apache.jena.enhanced.EnhGraph eg) Description copied from interface:EnhNodeFactory
Makes interface-defined changes in the given graph and returns a new enhanced node, wrapping the givenNode
.- Parameters:
node
-Node
, the node to be wrapped asEnhNode
, notnull
eg
-EnhGraph
, the graph which would contain the resultEnhNode
, notnull
- Returns:
- a new enhanced node
-
canCreateInGraph
public boolean canCreateInGraph(org.apache.jena.graph.Node node, org.apache.jena.enhanced.EnhGraph eg) Description copied from interface:EnhNodeFactory
Answerstrue
iff the modifying of thegraph
is allowed by this implementation for the encapsulated object's interface.- Parameters:
node
-Node
the node to test that changes are permitted.eg
-EnhGraph
the graph to be changed.- Returns:
- true if creation is allowed.
-
iterator
public org.apache.jena.util.iterator.ExtendedIterator<org.apache.jena.enhanced.EnhNode> iterator(org.apache.jena.enhanced.EnhGraph eg) Description copied from interface:EnhNodeFactory
Returns anExtended Iterator
over thenode
s found in theEnhGraph
in the form ofEnhNode
with the interface that this factory encapsulates. It is assumed that the returned iterator is distinct (does not answer with duplicates). At least, it must be distinct if theEnhGraph
encapsulates the distinct graph (see alsoGraphs.isDistinct(Graph)
).- Parameters:
eg
-EnhGraph
- Returns:
ExtendedIterator
ofEnhNode
s
-
createInstance
public org.apache.jena.enhanced.EnhNode createInstance(org.apache.jena.graph.Node node, org.apache.jena.enhanced.EnhGraph eg) Description copied from interface:EnhNodeFactory
Wraps the given pair ofnode
andgraph
to a freshEnhNode
instance without any checking or throwing any exception. Some implementations may returnnull
if theEnhNodeFactory.canWrap(Node, EnhGraph)
returnsfalse
. Unlike the methodEnhNodeFactory.createInGraph(Node, EnhGraph)
, this method does not make any changes to the graph.- Parameters:
node
-Node
, notnull
eg
-EnhGraph
, notnull
- Returns:
EnhNode
ornull
-