Class MultiUnion
- java.lang.Object
-
- org.apache.jena.graph.impl.GraphBase
-
- org.apache.jena.graph.compose.CompositionBase
-
- org.apache.jena.graph.compose.Polyadic
-
- org.apache.jena.graph.compose.MultiUnion
-
- All Implemented Interfaces:
Graph
,GraphWithPerform
public class MultiUnion extends Polyadic
A graph implementation that presents the union of zero or more subgraphs, one of which is distinguished as the updateable graph.
-
-
Field Summary
-
Fields inherited from class org.apache.jena.graph.impl.GraphBase
TOSTRING_TRIPLE_BASE, TOSTRING_TRIPLE_LIMIT
-
Fields inherited from interface org.apache.jena.graph.Graph
emptyGraph
-
-
Constructor Summary
Constructors Constructor Description MultiUnion()
Construct a union of exactly no sub graphs.MultiUnion(java.util.Iterator<Graph> graphs)
Construct a union of all of the given graphs.MultiUnion(Graph[] graphs)
Construct a union of all of the given graphs
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addGraph(Graph graph)
Add the given graph to this union.boolean
graphBaseContains(Triple t)
Answer true if at least one of the graphs in this union contain the given triple.ExtendedIterator<Triple>
graphBaseFind(Triple t)
Answer an iterator over the triples in the union of the graphs in this composition.void
performAdd(Triple t)
Add the given triple to the union model; the actual component model to be updated will be the designated (or default) updateable graph.void
performDelete(Triple t)
Delete the given triple from the union model; the actual component model to be updated will be the designated (or default) updateable graph.-
Methods inherited from class org.apache.jena.graph.compose.Polyadic
close, dependsOn, getBaseGraph, getCapabilities, getRequiredBaseGraph, getSubGraphs, getTransactionHandler, removeGraph, setBaseGraph
-
Methods inherited from class org.apache.jena.graph.compose.CompositionBase
butNot, ifIn, ifIn, recording, reject, rejecting, rejecting
-
Methods inherited from class org.apache.jena.graph.impl.GraphBase
add, clear, contains, contains, delete, find, find, forTestingOnly_graphBaseFind, getEventManager, getPrefixMapping, isClosed, isEmpty, isIsomorphicWith, notifyAdd, notifyDelete, remove, size, toString, toString
-
-
-
-
Constructor Detail
-
MultiUnion
public MultiUnion()
Construct a union of exactly no sub graphs.
-
MultiUnion
public MultiUnion(Graph[] graphs)
Construct a union of all of the given graphs
- Parameters:
graphs
- An array of the sub-graphs of this union
-
MultiUnion
public MultiUnion(java.util.Iterator<Graph> graphs)
Construct a union of all of the given graphs.
- Parameters:
graphs
- An iterator of the sub-graphs of this union. If graphs is a closable iterator, it will be automatically closed.
-
-
Method Detail
-
performAdd
public void performAdd(Triple t)
Add the given triple to the union model; the actual component model to be updated will be the designated (or default) updateable graph.
- Specified by:
performAdd
in interfaceGraphWithPerform
- Overrides:
performAdd
in classGraphBase
- Parameters:
t
- A triple to add to the union graph- Throws:
JenaException
- if the union does not contain any sub-graphs yet
-
performDelete
public void performDelete(Triple t)
Delete the given triple from the union model; the actual component model to be updated will be the designated (or default) updateable graph.
- Specified by:
performDelete
in interfaceGraphWithPerform
- Overrides:
performDelete
in classGraphBase
- Parameters:
t
- A triple to from the union graph- Throws:
JenaException
- if the union does not contain any sub-graphs yet
-
graphBaseContains
public boolean graphBaseContains(Triple t)
Answer true if at least one of the graphs in this union contain the given triple.
- Parameters:
t
- A triple- Returns:
- True if any of the graphs in the union contain t
-
graphBaseFind
public ExtendedIterator<Triple> graphBaseFind(Triple t)
Answer an iterator over the triples in the union of the graphs in this composition. Note that the requirement to remove duplicates from the union means that this will be an expensive operation for large (and especially for persistent) graphs.
- Parameters:
t
- The matcher to match against- Returns:
- An iterator of all triples matching t in the union of the graphs.
-
-