public class TinkerGraph extends Object implements Graph
Modifier and Type | Class and Description |
---|---|
static class |
TinkerGraph.TinkerGraphEdgeFeatures |
static class |
TinkerGraph.TinkerGraphFeatures |
static class |
TinkerGraph.TinkerGraphGraphFeatures |
static class |
TinkerGraph.TinkerGraphVertexFeatures |
Graph.Exceptions, Graph.Features, Graph.Helper, Graph.Hidden, Graph.Io, Graph.OptIn, Graph.OptIns, Graph.OptOut, Graph.OptOuts, Graph.Variables
Modifier and Type | Field and Description |
---|---|
protected Long |
currentId |
protected org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIndex<TinkerEdge> |
edgeIndex |
protected Map<Object,Edge> |
edges |
protected TinkerGraphView |
graphView |
protected TinkerGraphVariables |
variables |
protected org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIndex<TinkerVertex> |
vertexIndex |
protected Map<Object,Vertex> |
vertices |
Modifier and Type | Method and Description |
---|---|
Vertex |
addVertex(Object... keyValues)
Add a
Vertex to the graph given an optional series of key/value pairs. |
void |
clear() |
void |
close() |
GraphComputer |
compute() |
<C extends GraphComputer> |
compute(Class<C> graphComputerClass)
Declare the
GraphComputer to use for OLAP operations on the graph. |
Configuration |
configuration()
Get the
org.apache.commons.configuration.Configuration associated with the construction of this graph. |
<E extends Element> |
createIndex(String key,
Class<E> elementClass)
|
<E extends Element> |
dropIndex(String key,
Class<E> elementClass)
|
Iterator<Edge> |
edges(Object... edgeIds)
Get the
Edge objects in this graph with the provided edge ids. |
static TinkerGraph |
empty() |
Graph.Features |
features()
Return TinkerGraph feature set.
|
<E extends Element> |
getIndexedKeys(Class<E> elementClass)
|
static TinkerGraph |
open()
Open a new
TinkerGraph instance. |
static TinkerGraph |
open(Configuration configuration)
Open a new
TinkerGraph instance. |
String |
toString() |
Transaction |
tx()
Configure and control the transactions for those graphs that support this feature.
|
Graph.Variables |
variables()
A collection of global
Graph.Variables associated with the graph. |
Iterator<Vertex> |
vertices(Object... vertexIds)
Get the
Vertex objects in this graph with the provided vertex ids. |
protected Long currentId
protected TinkerGraphVariables variables
protected TinkerGraphView graphView
protected org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIndex<TinkerVertex> vertexIndex
protected org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIndex<TinkerEdge> edgeIndex
public static TinkerGraph empty()
public static TinkerGraph open()
TinkerGraph
instance.
Reference Implementation Help: If a Graph
implementation does not require a
org.apache.commons.configuration.Configuration
(or perhaps has a default configuration) it can choose to implement a zero argument
open() method. This is an optional constructor method for TinkerGraph. It is not enforced by the Gremlin
Test Suite.public static TinkerGraph open(Configuration configuration)
TinkerGraph
instance.
Reference Implementation Help: This method is the one use by the
GraphFactory
to instantiate
Graph
instances. This method must be overridden for the Structure Test
Suite to pass. Implementers have latitude in terms of how exceptions are handled within this method. Such
exceptions will be considered implementation specific by the test suite as all test generate graph instances
by way of GraphFactory
. As such, the exceptions get generalized
behind that facade and since GraphFactory
is the preferred method
to opening graphs it will be consistent at that level.configuration
- the configuration for the instanceGraph
public <C extends GraphComputer> C compute(Class<C> graphComputerClass)
Graph
GraphComputer
to use for OLAP operations on the graph.
If the graph does not support graph computer then an UnsupportedOperationException
is thrown.public GraphComputer compute()
public Graph.Variables variables()
Graph
Graph.Variables
associated with the graph.
Variables are used for storing metadata about the graph.public void clear()
public void close()
close
in interface AutoCloseable
public Transaction tx()
Graph
public Configuration configuration()
Graph
org.apache.commons.configuration.Configuration
associated with the construction of this graph.
Whatever configuration was passed to org.apache.tinkerpop.gremlin.structure.util.GraphFactory#open(org.apache.commons.configuration.Configuration)
is what should be returned by this method.configuration
in interface Graph
public Iterator<Vertex> vertices(Object... vertexIds)
Graph
Vertex
objects in this graph with the provided vertex ids. If no ids are provided, get all vertices.public Iterator<Edge> edges(Object... edgeIds)
Graph
Edge
objects in this graph with the provided edge ids. If no ids are provided, get all edges.public Graph.Features features()
Features
return true.public <E extends Element> void createIndex(String key, Class<E> elementClass)
Vertex
or Edge
) and said property key.
Whenever an element has the specified key mutated, the index is updated.
When the index is created, all existing elements are indexed to ensure that they are captured by the index.E
- The type of the element classkey
- the property key to indexelementClass
- the element class to indexpublic <E extends Element> void dropIndex(String key, Class<E> elementClass)
E
- The type of the element classkey
- the property key to stop indexingelementClass
- the element class of the index to dropCopyright © 2013–2015 Apache Software Foundation. All rights reserved.