Class EmptyGraph
- java.lang.Object
-
- org.apache.tinkerpop.gremlin.structure.util.empty.EmptyGraph
-
- All Implemented Interfaces:
AutoCloseable,Graph,Host
public final class EmptyGraph extends Object implements Graph
- Author:
- Marko A. Rodriguez (http://markorodriguez.com), Stephen Mallette (http://stephen.genoprime.com)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classEmptyGraph.EmptyGraphFactoryEmptyGraphdoesn't have a standardopen()method because it is a singleton.static classEmptyGraph.EmptyGraphFeaturesFeatures defined such that they support immutability but allow all other possibilities.-
Nested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.structure.Graph
Graph.Exceptions, Graph.Features, Graph.Hidden, Graph.OptIn, Graph.OptIns, Graph.OptOut, Graph.OptOuts, Graph.Variables
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description VertexaddVertex(Object... keyValues)Add aVertexto the graph given an optional series of key/value pairs.voidclose()Closing aGraphis equivalent to "shutdown" and implies that no further operations can be executed on the instance.GraphComputercompute()Generate aGraphComputerusing the default engine of the underlying graph system.<C extends GraphComputer>
Ccompute(Class<C> graphComputerClass)Declare theGraphComputerto use for OLAP operations on the graph.org.apache.commons.configuration2.Configurationconfiguration()Get theConfigurationassociated with the construction of this graph.Iterator<Edge>edges(Object... edgeIds)Graph.Featuresfeatures()Gets theGraph.Featuresexposed by the underlyingGraphimplementation.static Graphinstance()StringtoString()Transactiontx()Configure and control the transactions for those graphs that support this feature.Graph.Variablesvariables()A collection of globalGraph.Variablesassociated with the graph.Iterator<Vertex>vertices(Object... vertexIds)
-
-
-
Method Detail
-
instance
public static Graph instance()
-
features
public Graph.Features features()
Description copied from interface:GraphGets theGraph.Featuresexposed by the underlyingGraphimplementation.
-
compute
public <C extends GraphComputer> C compute(Class<C> graphComputerClass)
Description copied from interface:GraphDeclare theGraphComputerto use for OLAP operations on the graph. If the graph does not support graph computer then anUnsupportedOperationExceptionis thrown.
-
compute
public GraphComputer compute()
Description copied from interface:GraphGenerate aGraphComputerusing the default engine of the underlying graph system. This is a shorthand method for the more involved method that usesGraph.compute(Class).
-
tx
public Transaction tx()
Description copied from interface:GraphConfigure and control the transactions for those graphs that support this feature.
-
variables
public Graph.Variables variables()
Description copied from interface:GraphA collection of globalGraph.Variablesassociated with the graph. Variables are used for storing metadata about the graph.
-
configuration
public org.apache.commons.configuration2.Configuration configuration()
Description copied from interface:GraphGet theConfigurationassociated with the construction of this graph. Whatever configuration was passed toGraphFactory.open(Configuration)is what should be returned by this method.- Specified by:
configurationin interfaceGraph- Returns:
- the configuration used during graph construction.
-
close
public void close() throws ExceptionDescription copied from interface:GraphClosing aGraphis equivalent to "shutdown" and implies that no further operations can be executed on the instance. Users should consult the documentation of the underlying graph database implementation for what this "shutdown" will mean in general and, if supported, how open transactions are handled. It will typically be the end user's responsibility to synchronize the thread that callsclose()with other threads that are accessing open transactions. In other words, be sure that all work performed on theGraphinstance is complete prior to calling this method. TinkerPop does not enforce any particular semantics with respect to "shutdown". It is up to the graph provider to decide what this method will do.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceGraph- Throws:
Exception
-
vertices
public Iterator<Vertex> vertices(Object... vertexIds)
Description copied from interface:GraphGet theVertexobjects in this graph with the provided vertex ids orVertexobjects themselves. If no ids are provided, get all vertices. Note that a vertex identifier does not need to correspond to the actual id used in the graph. It needs to be a bit more flexible than that in that given theGraph.Featuresaround id support, multiple arguments might be applicable here. If the graph returntrueforGraph.Features.ElementFeatures.supportsNumericIds()then it should support filters as with:- g.vertices(v)
- g.vertices(v.id())
- g.vertices(1)
- g.vertices(1L)
- g.vertices(1.0d)
- g.vertices(1.0f)
- g.vertices("1")
trueforGraph.Features.ElementFeatures.supportsCustomIds()()} then it should support filters as with:- g.vertices(v)
- g.vertices(v.id())
- g.vertices(v.id().toString())
trueforGraph.Features.ElementFeatures.supportsAnyIds()()} then it should support filters as with:- g.vertices(v)
- g.vertices(v.id())
trueforGraph.Features.ElementFeatures.supportsStringIds()()} then it should support filters as with:- g.vertices(v)
- g.vertices(v.id().toString())
- g.vertices("id")
trueforGraph.Features.ElementFeatures.supportsStringIds()()} then it should support filters as with:- g.vertices(v)
- g.vertices(v.id().toString())
- g.vertices("id")
-
edges
public Iterator<Edge> edges(Object... edgeIds)
Description copied from interface:GraphGet theEdgeobjects in this graph with the provided edge ids orEdgeobjects. If no ids are provided, get all edges. Note that an edge identifier does not need to correspond to the actual id used in the graph. It needs to be a bit more flexible than that in that given theGraph.Featuresaround id support, multiple arguments might be applicable here. If the graph returntrueforGraph.Features.ElementFeatures.supportsNumericIds()then it should support filters as with:- g.edges(e)
- g.edges(e.id())
- g.edges(1)
- g.edges(1L)
- g.edges(1.0d)
- g.edges(1.0f)
- g.edges("1")
trueforGraph.Features.ElementFeatures.supportsCustomIds()()} then it should support filters as with:- g.edges(e)
- g.edges(e.id())
- g.edges(e.id().toString())
trueforGraph.Features.ElementFeatures.supportsAnyIds()()} then it should support filters as with:- g.edges(e)
- g.edges(e.id())
trueforGraph.Features.ElementFeatures.supportsStringIds()()} then it should support filters as with:- g.edges(e)
- g.edges(e.id().toString())
- g.edges("id")
-
-