Package org.apache.jena.graph.impl
Class CollectionGraph
- java.lang.Object
-
- org.apache.jena.graph.impl.GraphBase
-
- org.apache.jena.graph.impl.CollectionGraph
-
- All Implemented Interfaces:
Graph
,GraphWithPerform
public class CollectionGraph extends GraphBase
A simple graph implementation that wraps a collection of triples. This is intended to be used in places where a graph is required but iteration is the only expected operation. All graph operations are supported but many are not efficient and will be slow on large collections. In these cases a memory based graph will be more efficient.This implementation:
- Does not support deleting triples from the iterator
- Does not handle literal typing
-
-
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 CollectionGraph()
Construct an empty graph using an empty HashSet.CollectionGraph(java.util.Collection<Triple> triples)
Construct a graph from a collection.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Capabilities
getCapabilities()
Answer the capabilities of this graph; the default is an AllCapabilities object (the same one each time, not that it matters - Capabilities should be immutable).void
performAdd(Triple t)
Add a triple to the triple store.void
performDelete(Triple t)
Remove a triple from the triple store.-
Methods inherited from class org.apache.jena.graph.impl.GraphBase
add, clear, close, contains, contains, delete, dependsOn, find, find, forTestingOnly_graphBaseFind, getEventManager, getPrefixMapping, getTransactionHandler, isClosed, isEmpty, isIsomorphicWith, notifyAdd, notifyDelete, remove, size, toString, toString
-
-
-
-
Constructor Detail
-
CollectionGraph
public CollectionGraph()
Construct an empty graph using an empty HashSet. Iterator deletion is supported.
-
CollectionGraph
public CollectionGraph(java.util.Collection<Triple> triples)
Construct a graph from a collection. Iterator deletion is not supported.- Parameters:
triples
- The collection of triples.
-
-
Method Detail
-
performAdd
public void performAdd(Triple t)
Description copied from class:GraphBase
Add a triple to the triple store. The default implementation throws an AddDeniedException; subclasses must override if they want to be able to add triples.- Specified by:
performAdd
in interfaceGraphWithPerform
- Overrides:
performAdd
in classGraphBase
-
performDelete
public void performDelete(Triple t)
Description copied from class:GraphBase
Remove a triple from the triple store. The default implementation throws a DeleteDeniedException; subclasses must override if they want to be able to remove triples.- Specified by:
performDelete
in interfaceGraphWithPerform
- Overrides:
performDelete
in classGraphBase
-
getCapabilities
public Capabilities getCapabilities()
Description copied from class:GraphBase
Answer the capabilities of this graph; the default is an AllCapabilities object (the same one each time, not that it matters - Capabilities should be immutable).- Specified by:
getCapabilities
in interfaceGraph
- Overrides:
getCapabilities
in classGraphBase
-
-