public class TinkerGraph extends Object implements IndexableGraph, KeyIndexableGraph, Serializable
| Modifier and Type | Class and Description |
|---|---|
static class |
TinkerGraph.FileType |
protected class |
TinkerGraph.TinkerKeyIndex<T extends com.tinkerpop.blueprints.impls.tg.TinkerElement> |
| Modifier and Type | Field and Description |
|---|---|
protected Long |
currentId |
protected TinkerGraph.TinkerKeyIndex<com.tinkerpop.blueprints.impls.tg.TinkerEdge> |
edgeKeyIndex |
protected Map<String,Edge> |
edges |
protected Map<String,com.tinkerpop.blueprints.impls.tg.TinkerIndex> |
indices |
protected TinkerGraph.TinkerKeyIndex<com.tinkerpop.blueprints.impls.tg.TinkerVertex> |
vertexKeyIndex |
protected Map<String,Vertex> |
vertices |
| Constructor and Description |
|---|
TinkerGraph() |
TinkerGraph(org.apache.commons.configuration.Configuration configuration) |
TinkerGraph(String directory) |
TinkerGraph(String directory,
TinkerGraph.FileType fileType) |
| Modifier and Type | Method and Description |
|---|---|
Edge |
addEdge(Object id,
Vertex outVertex,
Vertex inVertex,
String label)
Add an edge to the graph.
|
Vertex |
addVertex(Object id)
Create a new vertex, add it to the graph, and return the newly created vertex.
|
void |
clear() |
<T extends Element> |
createIndex(String indexName,
Class<T> indexClass,
Parameter... indexParameters)
Generate an index with a particular name for a particular class.
|
<T extends Element> |
createKeyIndex(String key,
Class<T> elementClass,
Parameter... indexParameters)
Create an automatic indexing structure for indexing provided key for element class.
|
void |
dropIndex(String indexName)
Remove an index associated with the graph.
|
<T extends Element> |
dropKeyIndex(String key,
Class<T> elementClass)
Remove an automatic indexing structure associated with indexing provided key for element class.
|
Edge |
getEdge(Object id)
Return the edge referenced by the provided object identifier.
|
Iterable<Edge> |
getEdges()
Return an iterable to all the edges in the graph.
|
Iterable<Edge> |
getEdges(String key,
Object value)
Return an iterable to all the edges in the graph that have a particular key/value property.
|
Features |
getFeatures()
Get the particular features of the graph implementation.
|
<T extends Element> |
getIndex(String indexName,
Class<T> indexClass)
Get an index from the graph by its name and index class.
|
<T extends Element> |
getIndexedKeys(Class<T> elementClass)
Return all the index keys associated with a particular element class.
|
Iterable<Index<? extends Element>> |
getIndices()
Get all the indices maintained by the graph.
|
Vertex |
getVertex(Object id)
Return the vertex referenced by the provided object identifier.
|
Iterable<Vertex> |
getVertices()
Return an iterable to all the vertices in the graph.
|
Iterable<Vertex> |
getVertices(String key,
Object value)
Return an iterable to all the vertices in the graph that have a particular key/value property.
|
GraphQuery |
query()
Generate a query object that can be used to fine tune which edges/vertices are retrieved from the graph.
|
void |
removeEdge(Edge edge)
Remove the provided edge from the graph.
|
void |
removeVertex(Vertex vertex)
Remove the provided vertex from the graph.
|
void |
shutdown()
A shutdown function is required to properly close the graph.
|
String |
toString() |
protected Long currentId
protected TinkerGraph.TinkerKeyIndex<com.tinkerpop.blueprints.impls.tg.TinkerVertex> vertexKeyIndex
protected TinkerGraph.TinkerKeyIndex<com.tinkerpop.blueprints.impls.tg.TinkerEdge> edgeKeyIndex
public TinkerGraph(org.apache.commons.configuration.Configuration configuration)
public TinkerGraph(String directory, TinkerGraph.FileType fileType)
public TinkerGraph(String directory)
public TinkerGraph()
public Iterable<Vertex> getVertices(String key, Object value)
GraphgetVertices in interface Graphkey - the key of vertexvalue - the value of the vertexpublic Iterable<Edge> getEdges(String key, Object value)
Graphpublic <T extends Element> void createKeyIndex(String key, Class<T> elementClass, Parameter... indexParameters)
KeyIndexableGraphcreateKeyIndex in interface KeyIndexableGraphT - the element class specificationkey - the key to create the index forelementClass - the element class that the index is forindexParameters - a collection of parameters for the underlying index implementationpublic <T extends Element> void dropKeyIndex(String key, Class<T> elementClass)
KeyIndexableGraphdropKeyIndex in interface KeyIndexableGraphT - the element class specificationkey - the key to drop the index forelementClass - the element class that the index is forpublic <T extends Element> Set<String> getIndexedKeys(Class<T> elementClass)
KeyIndexableGraphgetIndexedKeys in interface KeyIndexableGraphT - the element class specificationelementClass - the element class that the index is forpublic <T extends Element> Index<T> createIndex(String indexName, Class<T> indexClass, Parameter... indexParameters)
IndexableGraphcreateIndex in interface IndexableGraphT - the element class that this index is indexing (can be base class)indexName - the name of the manual indexindexClass - the element class that this index is indexing (can be base class)indexParameters - a collection of parameters for the underlying index implementationpublic <T extends Element> Index<T> getIndex(String indexName, Class<T> indexClass)
IndexableGraphgetIndex in interface IndexableGraphT - the class of the elements being indexed (can be base class)indexName - the name of the index to retrieveindexClass - the class of the elements being indexed (can be base class)public Iterable<Index<? extends Element>> getIndices()
IndexableGraphgetIndices in interface IndexableGraphpublic void dropIndex(String indexName)
IndexableGraphdropIndex in interface IndexableGraphindexName - the name of the index to droppublic Vertex addVertex(Object id)
Graphpublic Vertex getVertex(Object id)
Graphpublic Edge getEdge(Object id)
Graphpublic Iterable<Vertex> getVertices()
GraphgetVertices in interface Graphpublic Iterable<Edge> getEdges()
Graphpublic void removeVertex(Vertex vertex)
GraphremoveVertex in interface Graphvertex - the vertex to remove from the graphpublic Edge addEdge(Object id, Vertex outVertex, Vertex inVertex, String label)
Graphpublic void removeEdge(Edge edge)
GraphremoveEdge in interface Graphedge - the edge to remove from the graphpublic GraphQuery query()
Graphpublic void clear()
public void shutdown()
Graphpublic Features getFeatures()
GraphgetFeatures in interface GraphCopyright © 2010-2014. All Rights Reserved.