public final class StarGraph extends Object implements Graph, Serializable
StarGraph is a form of Attachable (though the Graph implementation does not implement
that interface itself). It is a very limited Graph implementation that holds a single Vertex
and its related properties and edges (and their properties). It is designed to be an efficient memory
representation of this data structure, thus making it good for network and disk-based serialization.| Modifier and Type | Class and Description |
|---|---|
class |
StarGraph.StarAdjacentVertex |
class |
StarGraph.StarEdge |
class |
StarGraph.StarElement<E extends Element> |
static class |
StarGraph.StarGraphFeatures |
class |
StarGraph.StarInEdge |
class |
StarGraph.StarOutEdge |
class |
StarGraph.StarProperty<V> |
class |
StarGraph.StarVertex |
class |
StarGraph.StarVertexProperty<V> |
Graph.Exceptions, Graph.Features, Graph.Hidden, Graph.OptIn, Graph.OptIns, Graph.OptOut, Graph.OptOuts, Graph.Variables| Modifier and Type | Field and Description |
|---|---|
protected Map<Object,Map<String,Object>> |
edgeProperties |
protected Map<Object,Map<String,Object>> |
metaProperties |
protected Long |
nextId |
protected StarGraph.StarVertex |
starVertex |
| 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 |
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. |
Iterator<Edge> |
edges(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. |
StarGraph.StarVertex |
getStarVertex()
|
static StarGraph |
of(Vertex vertex)
|
static StarGraph |
open()
Creates an empty
StarGraph. |
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 nextId
protected StarGraph.StarVertex starVertex
public StarGraph.StarVertex getStarVertex()
public <C extends GraphComputer> C compute(Class<C> graphComputerClass) throws IllegalArgumentException
GraphGraphComputer to use for OLAP operations on the graph.
If the graph does not support graph computer then an UnsupportedOperationException is thrown.compute in interface GraphgraphComputerClass - The graph computer class to use.IllegalArgumentException - if the provided GraphComputer class is not supported.public GraphComputer compute() throws IllegalArgumentException
compute in interface GraphIllegalArgumentExceptionpublic Iterator<Vertex> vertices(Object... vertexIds)
GraphVertex objects in this graph with the provided vertex ids. 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 the Graph.Features around id support, multiple
arguments might be applicable here.
If the graph return true for Graph.Features.ElementFeatures.supportsNumericIds() then it should support
filters as with:
true for Graph.Features.ElementFeatures.supportsCustomIds() ()} then it should support
filters as with:
true for Graph.Features.ElementFeatures.supportsAnyIds() ()} then it should support
filters as with:
true for Graph.Features.ElementFeatures.supportsStringIds() ()} then it should support
filters as with:
true for Graph.Features.ElementFeatures.supportsStringIds() ()} then it should support
filters as with:
public Iterator<Edge> edges(Object... edgeIds)
GraphEdge objects in this graph with the provided edge ids. 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 the Graph.Features around id support, multiple
arguments might be applicable here.
If the graph return true for Graph.Features.ElementFeatures.supportsNumericIds() then it should support
filters as with:
true for Graph.Features.ElementFeatures.supportsCustomIds() ()} then it should support
filters as with:
true for Graph.Features.ElementFeatures.supportsAnyIds() ()} then it should support
filters as with:
true for Graph.Features.ElementFeatures.supportsStringIds() ()} then it should support
filters as with:
public Transaction tx()
Graphpublic Graph.Variables variables()
GraphGraph.Variables associated with the graph.
Variables are used for storing metadata about the graph.public Configuration configuration()
Graphorg.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 Graphpublic Graph.Features features()
GraphGraph.Features exposed by the underlying Graph implementation.public void close()
throws Exception
close in interface AutoCloseableExceptionCopyright © 2013–2015 Apache Software Foundation. All rights reserved.