Package org.apache.jena.util
Class MonitorGraph
- java.lang.Object
-
- org.apache.jena.graph.impl.WrappedGraph
-
- org.apache.jena.util.MonitorGraph
-
- All Implemented Interfaces:
Graph
,GraphWithPerform
public class MonitorGraph extends WrappedGraph
Graph wrapper which provides normal access to an underlying graph but also maintains a snapshot of the triples it was last known to contain. A snapshot action causes the set of changes between this and the previous snapshot to be calculated and the cache updated. The snapshot process will also fire change notification.
-
-
Field Summary
-
Fields inherited from interface org.apache.jena.graph.Graph
emptyGraph
-
-
Constructor Summary
Constructors Constructor Description MonitorGraph(Graph g)
Constructor, wrap the given graph with a state monitor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
snapshot(java.util.List<Triple> additions, java.util.List<Triple> deletions)
Compute the differences between the current monitored graph and the last snapshot.-
Methods inherited from class org.apache.jena.graph.impl.WrappedGraph
add, clear, close, contains, contains, delete, dependsOn, find, find, getCapabilities, getEventManager, getPrefixMapping, getTransactionHandler, getWrapped, isClosed, isEmpty, isIsomorphicWith, performAdd, performDelete, remove, size
-
-
-
-
Constructor Detail
-
MonitorGraph
public MonitorGraph(Graph g)
Constructor, wrap the given graph with a state monitor
-
-
Method Detail
-
snapshot
public void snapshot(java.util.List<Triple> additions, java.util.List<Triple> deletions)
Compute the differences between the current monitored graph and the last snapshot. The changes will also be forwarded to any listeners. Then take a new snapshot.- Parameters:
additions
- a place in which the set of newly added triples should be noted, can be nulldeletions
- a place in which the set of newly deleted triples should be noted, can be null
-
-