public class StrategyGraph extends java.lang.Object implements Graph, Graph.Iterators, StrategyWrapped, WrappedGraph<Graph>
Graph instances that host and apply a GraphStrategy. The wrapper implements
Graph itself and intercepts calls made to the hosted instance and then applies the strategy. Methods
that return an extension of Element or a
Property will be automatically wrapped in a StrategyWrapped
implementation.| Modifier and Type | Class and Description |
|---|---|
static class |
StrategyGraph.Exceptions |
Graph.Features, Graph.Helper, Graph.Hidden, Graph.Io, Graph.Iterators, Graph.OptIn, Graph.OptIns, Graph.OptOut, Graph.OptOuts, Graph.Variables| Constructor and Description |
|---|
StrategyGraph(Graph baseGraph) |
StrategyGraph(Graph baseGraph,
GraphStrategy strategy) |
| Modifier and Type | Method and Description |
|---|---|
Vertex |
addVertex(java.lang.Object... keyValues)
Add a
Vertex to the graph given an optional series of key/value pairs. |
void |
close() |
<T> T |
compose(java.util.function.Function<GraphStrategy,java.util.function.UnaryOperator<T>> f,
T impl)
Return a
GraphStrategy function that takes the base function of the form denoted by T as
an argument and returns back a function with T. |
GraphComputer |
compute(java.lang.Class... graphComputerClass)
Create an OLAP
GraphComputer to execute a vertex program over this graph. |
org.apache.commons.configuration.Configuration |
configuration()
Get the
Configuration associated with the construction of this graph. |
GraphTraversal<Edge,Edge> |
E(java.lang.Object... edgeIds)
Starts a
GraphTraversal over the edges in the graph. |
java.util.Iterator<Edge> |
edgeIterator(java.lang.Object... edgeIds)
Get the
Edge objects in this graph with the provided edge ids. |
Graph.Features |
features()
Gets the
Graph.Features exposed by the underlying Graph implementation. |
Graph |
getBaseGraph()
Gets the underlying base
Graph that is being hosted within this wrapper. |
GraphStrategy |
getStrategy()
Gets the
GraphStrategy for the Graph. |
Graph.Iterators |
iterators()
Get the
Graph.Iterators associated with this graph. |
<T extends Traversal<S,S>,S> |
of(java.lang.Class<T> traversalClass)
Constructs a new domain specific
Traversal for this graph. |
java.lang.String |
toString() |
Transaction |
tx()
Configure and control the transactions for those graphs that support this feature.
|
GraphTraversal<Vertex,Vertex> |
V(java.lang.Object... vertexIds)
Starts a
GraphTraversal over the vertices in the graph. |
Graph.Variables |
variables()
A collection of global
Graph.Variables associated with the graph. |
java.util.Iterator<Vertex> |
vertexIterator(java.lang.Object... vertexIds)
Get the
Vertex objects in this graph with the provided vertex ids. |
public StrategyGraph(Graph baseGraph)
public StrategyGraph(Graph baseGraph, GraphStrategy strategy)
public Graph getBaseGraph()
Graph that is being hosted within this wrapper.getBaseGraph in interface WrappedGraph<Graph>public GraphStrategy getStrategy()
GraphStrategy for the Graph.public <T> T compose(java.util.function.Function<GraphStrategy,java.util.function.UnaryOperator<T>> f, T impl)
GraphStrategy function that takes the base function of the form denoted by T as
an argument and returns back a function with T.f - a function to execute if a GraphStrategy.impl - the base implementation of an operation.public Vertex addVertex(java.lang.Object... keyValues)
GraphVertex to the graph given an optional series of key/value pairs. These key/values
must be provided in an even number where the odd numbered arguments are String property keys and the
even numbered arguments are the related property values.public GraphTraversal<Vertex,Vertex> V(java.lang.Object... vertexIds)
GraphGraphTraversal over the vertices in the graph.
If vertexIds are provided, then the traversal starts at those vertices, else all vertices in the graph.public GraphTraversal<Edge,Edge> E(java.lang.Object... edgeIds)
GraphGraphTraversal over the edges in the graph.
If edgeIds are provided, then the traversal starts at those edges, else all edges in the graph.public <T extends Traversal<S,S>,S> T of(java.lang.Class<T> traversalClass)
GraphTraversal for this graph.public GraphComputer compute(java.lang.Class... graphComputerClass)
GraphGraphComputer to execute a vertex program over this graph.
If the graph does not support graph computer then an UnsupportedOperationException is thrown.
The provided arguments can be of either length 0 or 1. A graph can support multiple graph computers.public Transaction tx()
Graphpublic Graph.Variables variables()
GraphGraph.Variables associated with the graph.
Variables are used for storing metadata about the graph.public org.apache.commons.configuration.Configuration configuration()
GraphConfiguration associated with the construction of this graph.
Whatever configuration was passed to GraphFactory.open(org.apache.commons.configuration.Configuration)
is what should be returned by this method.configuration in interface Graphpublic Graph.Features features()
GraphGraph.Features exposed by the underlying Graph implementation.public Graph.Iterators iterators()
GraphGraph.Iterators associated with this graph.public java.util.Iterator<Vertex> vertexIterator(java.lang.Object... vertexIds)
Graph.IteratorsVertex objects in this graph with the provided vertex ids. If no ids are provided, get all vertices.vertexIterator in interface Graph.IteratorsvertexIds - the ids of the vertices to getIterator of vertices that match the provided vertex idspublic java.util.Iterator<Edge> edgeIterator(java.lang.Object... edgeIds)
Graph.IteratorsEdge objects in this graph with the provided edge ids. If no ids are provided, get all edges.edgeIterator in interface Graph.IteratorsedgeIds - the ids of the edges to getIterator of edges that match the provided edge idspublic void close()
throws java.lang.Exception
close in interface java.lang.AutoCloseablejava.lang.Exceptionpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2013-2015 TinkerPop. All Rights Reserved.