G
- the "self"-type of this graph@ParametersAreNonnullByDefault public class IdGraph<G extends IdGraph<G>> extends Object implements com.tinkerpop.blueprints.util.wrappers.WrapperGraph<com.tinkerpop.blueprints.KeyIndexableGraph>, com.tinkerpop.blueprints.KeyIndexableGraph, com.tinkerpop.blueprints.IndexableGraph, com.tinkerpop.blueprints.TransactionalGraph
KeyIndexableGraph
able to map the result of each method call to a dedicated
implementation.
Re-implemented from com.tinkerpop.blueprints.util.wrappers.id.IdGraph
.
Modifier and Type | Field and Description |
---|---|
protected static String |
ID
The property key used to identify
Vertex and Edge instances. |
Constructor and Description |
---|
IdGraph(com.tinkerpop.blueprints.KeyIndexableGraph baseGraph,
boolean supportVertexIds,
boolean supportEdgeIds)
Adds custom ID functionality to the given graph, supporting either custom vertex IDs, custom edge IDs, or both.
|
Modifier and Type | Method and Description |
---|---|
com.tinkerpop.blueprints.Edge |
addEdge(Object id,
com.tinkerpop.blueprints.Vertex outVertex,
com.tinkerpop.blueprints.Vertex inVertex,
String label) |
<E extends com.tinkerpop.blueprints.Edge> |
addEdge(Object id,
com.tinkerpop.blueprints.Vertex outVertex,
com.tinkerpop.blueprints.Vertex inVertex,
String label,
BiFunction<com.tinkerpop.blueprints.Edge,G,E> mappingFunc)
Add an edge to the graph.
|
com.tinkerpop.blueprints.Vertex |
addVertex(Object id) |
<V extends com.tinkerpop.blueprints.Vertex> |
addVertex(Object id,
BiFunction<com.tinkerpop.blueprints.Vertex,G,V> mappingFunc)
Create a new vertex, add it to the graph, and return the newly created vertex.
|
void |
commit() |
<E extends com.tinkerpop.blueprints.Element> |
createIndex(String indexName,
Class<E> indexClass,
com.tinkerpop.blueprints.Parameter... indexParameters) |
<T extends com.tinkerpop.blueprints.Element,U extends T> |
createIndex(String indexName,
Class<T> indexClass,
BiFunction<T,G,U> mappingFunc)
Generate an index with a particular name for a particular class.
|
<E extends com.tinkerpop.blueprints.Element> |
createKeyIndex(String key,
Class<E> elementClass,
com.tinkerpop.blueprints.Parameter... indexParameters) |
void |
dropIndex(String indexName) |
<E extends com.tinkerpop.blueprints.Element> |
dropKeyIndex(String key,
Class<E> elementClass) |
com.tinkerpop.blueprints.KeyIndexableGraph |
getBaseGraph() |
com.tinkerpop.blueprints.Edge |
getEdge(Object id) |
<E extends com.tinkerpop.blueprints.Edge> |
getEdge(Object id,
BiFunction<com.tinkerpop.blueprints.Edge,G,E> mappingFunc)
Return the edge referenced by the provided object identifier.
|
Iterable<com.tinkerpop.blueprints.Edge> |
getEdges() |
<E extends com.tinkerpop.blueprints.Edge> |
getEdges(BiFunction<com.tinkerpop.blueprints.Edge,G,E> mappingFunc)
Return an iterable to all the edges in the graph.
|
Iterable<com.tinkerpop.blueprints.Edge> |
getEdges(String key,
Object value) |
<E extends com.tinkerpop.blueprints.Edge> |
getEdges(String key,
Object value,
BiFunction<com.tinkerpop.blueprints.Edge,G,E> mappingFunc)
Return an iterable to all the edges in the graph that have a particular key/value property.
|
com.tinkerpop.blueprints.Features |
getFeatures() |
<E extends com.tinkerpop.blueprints.Element> |
getIndex(String indexName,
Class<E> indexClass) |
<T extends com.tinkerpop.blueprints.Element,U extends T> |
getIndex(String indexName,
Class<T> indexClass,
BiFunction<T,G,U> mappingFunc)
Get an index from the graph by its name and index class.
|
<E extends com.tinkerpop.blueprints.Element> |
getIndexedKeys(Class<E> elementClass) |
Iterable<com.tinkerpop.blueprints.Index<? extends com.tinkerpop.blueprints.Element>> |
getIndices() |
<T extends com.tinkerpop.blueprints.Element,U extends T> |
getOrCreateIndex(String indexName,
Class<T> indexClass,
BiFunction<T,G,U> mappingFunc)
Returns the index, from the graph, by its name and index class.
|
com.tinkerpop.blueprints.Vertex |
getVertex(Object id) |
<V extends com.tinkerpop.blueprints.Vertex> |
getVertex(Object id,
BiFunction<com.tinkerpop.blueprints.Vertex,G,V> mappingFunc)
Return the vertex referenced by the provided object identifier.
|
Iterable<com.tinkerpop.blueprints.Vertex> |
getVertices() |
<V extends com.tinkerpop.blueprints.Vertex> |
getVertices(BiFunction<com.tinkerpop.blueprints.Vertex,G,V> mappingFunc)
Return an iterable to all the vertices in the graph.
|
Iterable<com.tinkerpop.blueprints.Vertex> |
getVertices(String key,
Object value) |
<V extends com.tinkerpop.blueprints.Vertex> |
getVertices(String key,
Object value,
BiFunction<com.tinkerpop.blueprints.Vertex,G,V> mappingFunc)
Return an iterable to all the vertices in the graph that have a particular key/value property.
|
boolean |
isSupportEdgeIds()
Returns
true if this graph support custom edge IDs. |
boolean |
isSupportVertexIds()
Returns
true if this graph support custom vertex IDs. |
IdGraphQuery<G> |
query() |
void |
removeEdge(com.tinkerpop.blueprints.Edge edge) |
void |
removeVertex(com.tinkerpop.blueprints.Vertex vertex) |
void |
rollback() |
void |
shutdown() |
void |
stopTransaction(com.tinkerpop.blueprints.TransactionalGraph.Conclusion conclusion)
Deprecated.
Follow the Blueprints API
|
String |
toString() |
@Nonnull protected static final String ID
Vertex
and Edge
instances.
NOTE: using "__id" instead of "_id" avoids collision with Rexster's "_id".public IdGraph(com.tinkerpop.blueprints.KeyIndexableGraph baseGraph, boolean supportVertexIds, boolean supportEdgeIds)
baseGraph
- the base graph which does not necessarily support custom IDssupportVertexIds
- whether to support custom vertex IDssupportEdgeIds
- whether to support custom edge IDspublic boolean isSupportVertexIds()
true
if this graph support custom vertex IDs.true
if this graph support custom vertex IDs.public boolean isSupportEdgeIds()
true
if this graph support custom edge IDs.true
if this graph support custom edge IDs.@Nonnull public com.tinkerpop.blueprints.Features getFeatures()
getFeatures
in interface com.tinkerpop.blueprints.Graph
@Nonnull public com.tinkerpop.blueprints.Vertex addVertex(@Nullable Object id)
addVertex
in interface com.tinkerpop.blueprints.Graph
public com.tinkerpop.blueprints.Vertex getVertex(Object id)
getVertex
in interface com.tinkerpop.blueprints.Graph
public void removeVertex(com.tinkerpop.blueprints.Vertex vertex)
removeVertex
in interface com.tinkerpop.blueprints.Graph
@Nonnull public Iterable<com.tinkerpop.blueprints.Vertex> getVertices()
getVertices
in interface com.tinkerpop.blueprints.Graph
@Nonnull public Iterable<com.tinkerpop.blueprints.Vertex> getVertices(String key, Object value)
getVertices
in interface com.tinkerpop.blueprints.Graph
@Nonnull public com.tinkerpop.blueprints.Edge addEdge(@Nullable Object id, com.tinkerpop.blueprints.Vertex outVertex, com.tinkerpop.blueprints.Vertex inVertex, String label)
addEdge
in interface com.tinkerpop.blueprints.Graph
public com.tinkerpop.blueprints.Edge getEdge(Object id)
getEdge
in interface com.tinkerpop.blueprints.Graph
public void removeEdge(com.tinkerpop.blueprints.Edge edge)
removeEdge
in interface com.tinkerpop.blueprints.Graph
@Nonnull public Iterable<com.tinkerpop.blueprints.Edge> getEdges()
getEdges
in interface com.tinkerpop.blueprints.Graph
@Nonnull public Iterable<com.tinkerpop.blueprints.Edge> getEdges(String key, Object value)
getEdges
in interface com.tinkerpop.blueprints.Graph
@Nonnull public IdGraphQuery<G> query()
query
in interface com.tinkerpop.blueprints.Graph
public void shutdown()
shutdown
in interface com.tinkerpop.blueprints.Graph
@Nonnull public com.tinkerpop.blueprints.KeyIndexableGraph getBaseGraph()
getBaseGraph
in interface com.tinkerpop.blueprints.util.wrappers.WrapperGraph<com.tinkerpop.blueprints.KeyIndexableGraph>
@Deprecated public void stopTransaction(com.tinkerpop.blueprints.TransactionalGraph.Conclusion conclusion)
This is a no-op if the base graph is not an instance of TransactionalGraph
.
stopTransaction
in interface com.tinkerpop.blueprints.TransactionalGraph
public void commit()
commit
in interface com.tinkerpop.blueprints.TransactionalGraph
public void rollback()
rollback
in interface com.tinkerpop.blueprints.TransactionalGraph
public <E extends com.tinkerpop.blueprints.Element> void dropKeyIndex(String key, Class<E> elementClass)
dropKeyIndex
in interface com.tinkerpop.blueprints.KeyIndexableGraph
public <E extends com.tinkerpop.blueprints.Element> void createKeyIndex(String key, Class<E> elementClass, com.tinkerpop.blueprints.Parameter... indexParameters)
createKeyIndex
in interface com.tinkerpop.blueprints.KeyIndexableGraph
@Nonnull public <E extends com.tinkerpop.blueprints.Element> Set<String> getIndexedKeys(Class<E> elementClass)
getIndexedKeys
in interface com.tinkerpop.blueprints.KeyIndexableGraph
@Nonnull public <E extends com.tinkerpop.blueprints.Element> com.tinkerpop.blueprints.Index<E> createIndex(String indexName, Class<E> indexClass, com.tinkerpop.blueprints.Parameter... indexParameters)
createIndex
in interface com.tinkerpop.blueprints.IndexableGraph
public <E extends com.tinkerpop.blueprints.Element> com.tinkerpop.blueprints.Index<E> getIndex(String indexName, Class<E> indexClass)
getIndex
in interface com.tinkerpop.blueprints.IndexableGraph
@Nonnull public Iterable<com.tinkerpop.blueprints.Index<? extends com.tinkerpop.blueprints.Element>> getIndices()
getIndices
in interface com.tinkerpop.blueprints.IndexableGraph
public void dropIndex(String indexName)
dropIndex
in interface com.tinkerpop.blueprints.IndexableGraph
@Nonnull public <V extends com.tinkerpop.blueprints.Vertex> V addVertex(@Nullable Object id, BiFunction<com.tinkerpop.blueprints.Vertex,G,V> mappingFunc)
V
- the type of the vertex after mappingid
- the identifier of the vertexmappingFunc
- the function to create a new dedicated vertex from anotheraddVertex(Object)
@Nonnull public <V extends com.tinkerpop.blueprints.Vertex> Optional<V> getVertex(Object id, BiFunction<com.tinkerpop.blueprints.Vertex,G,V> mappingFunc)
V
- the type of the vertex after mappingid
- the identifier of the vertexmappingFunc
- the function to create a new dedicated vertex from anotherOptional
containing the vertex referenced by the provided identifiergetVertex(Object)
@Nonnull public <V extends com.tinkerpop.blueprints.Vertex> Iterable<V> getVertices(BiFunction<com.tinkerpop.blueprints.Vertex,G,V> mappingFunc)
V
- the type of the vertex after mappingmappingFunc
- the function to create a new dedicated vertex from anothergetVertices()
@Nonnull public <V extends com.tinkerpop.blueprints.Vertex> Iterable<V> getVertices(String key, Object value, BiFunction<com.tinkerpop.blueprints.Vertex,G,V> mappingFunc)
V
- the type of the vertex after mappingkey
- the key of vertexvalue
- the value of the vertexmappingFunc
- the function to create a new dedicated vertex from anothergetVertices(String, Object)
@Nonnull public <E extends com.tinkerpop.blueprints.Edge> E addEdge(@Nullable Object id, com.tinkerpop.blueprints.Vertex outVertex, com.tinkerpop.blueprints.Vertex inVertex, String label, BiFunction<com.tinkerpop.blueprints.Edge,G,E> mappingFunc)
E
- the type of the edge after mappingid
- the identifier of the edgeoutVertex
- the vertex on the tail of the edgeinVertex
- the vertex on the head of the edgelabel
- the label associated with the edgemappingFunc
- the function to create a new dedicated edge from anotheraddEdge(Object, Vertex, Vertex, String)
@Nonnull public <E extends com.tinkerpop.blueprints.Edge> Optional<E> getEdge(Object id, BiFunction<com.tinkerpop.blueprints.Edge,G,E> mappingFunc)
E
- the type of the edge after mappingid
- the identifier of the edge to retrieved from the graphmappingFunc
- the function to create a new dedicated edge from anotherOptional
containing the edge referenced by the provided identifiergetEdge(Object)
@Nonnull public <E extends com.tinkerpop.blueprints.Edge> Iterable<E> getEdges(BiFunction<com.tinkerpop.blueprints.Edge,G,E> mappingFunc)
E
- the type of the edge after mappingmappingFunc
- the function to create a new dedicated edge from anothergetEdges()
@Nonnull public <E extends com.tinkerpop.blueprints.Edge> Iterable<E> getEdges(String key, Object value, BiFunction<com.tinkerpop.blueprints.Edge,G,E> mappingFunc)
E
- the type of the edge after mappingkey
- the key of the edgevalue
- the value of the edgemappingFunc
- the function to create a new dedicated edge from anothergetEdges(String, Object)
@Nonnull public <T extends com.tinkerpop.blueprints.Element,U extends T> com.tinkerpop.blueprints.Index<U> createIndex(String indexName, Class<T> indexClass, BiFunction<T,G,U> mappingFunc)
T
- the element class that this index is indexing (can be base class)U
- the type of the edge indexed element mappingindexName
- the name of the manual indexindexClass
- the element class that this index is indexing (can be base class)mappingFunc
- the function to create a new dedicated element from anothercreateIndex(String, Class, Parameter[])
@Nullable public <T extends com.tinkerpop.blueprints.Element,U extends T> com.tinkerpop.blueprints.Index<U> getIndex(String indexName, Class<T> indexClass, BiFunction<T,G,U> mappingFunc)
T
- the class of the elements being indexed (can be base class)U
- the type of the edge indexed element mappingindexName
- the name of the index to retrieveindexClass
- the class of the elements being indexed (can be base class)mappingFunc
- the function to create a new dedicated element from anothergetIndex(String, Class)
@Nonnull public <T extends com.tinkerpop.blueprints.Element,U extends T> com.tinkerpop.blueprints.Index<U> getOrCreateIndex(String indexName, Class<T> indexClass, BiFunction<T,G,U> mappingFunc)
T
- the element class that this index is indexing (can be base class)U
- the type of the edge indexed element mappingindexName
- the name of the manual indexindexClass
- the element class that this index is indexing (can be base class)mappingFunc
- the function to create a new dedicated element from anothergetIndex(String, Class, BiFunction)
,
createIndex(String, Class, BiFunction)
Copyright © 2013–2019 Atlanmod. All rights reserved.