Package com.arcadedb.graph
Class GraphEngine
- java.lang.Object
-
- com.arcadedb.graph.GraphEngine
-
public class GraphEngine extends Object
Central class to work with graphs. This is not intended to be used by the end user, but rather from Vertex and Edge classes.- Author:
- Luca Garulli ([email protected])
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GraphEngine.CreateEdgeOperation
-
Field Summary
Fields Modifier and Type Field Description static String
IN_EDGES_SUFFIX
static String
OUT_EDGES_SUFFIX
-
Constructor Summary
Constructors Constructor Description GraphEngine(DatabaseInternal database)
-
Method Summary
-
-
-
Field Detail
-
OUT_EDGES_SUFFIX
public static final String OUT_EDGES_SUFFIX
- See Also:
- Constant Field Values
-
IN_EDGES_SUFFIX
public static final String IN_EDGES_SUFFIX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GraphEngine
public GraphEngine(DatabaseInternal database)
-
-
Method Detail
-
createVertexType
public void createVertexType(VertexType type)
-
dropVertexType
public void dropVertexType(VertexType type)
-
newLightEdge
public ImmutableLightEdge newLightEdge(VertexInternal fromVertex, String edgeTypeName, Identifiable toVertex, boolean bidirectional)
-
newEdge
public MutableEdge newEdge(VertexInternal fromVertex, String edgeTypeName, Identifiable toVertex, boolean bidirectional, Object... edgeProperties)
-
connectEdge
public void connectEdge(VertexInternal fromVertex, Identifiable toVertex, Edge edge, boolean bidirectional)
-
upgradeEdge
public void upgradeEdge(VertexInternal fromVertex, Identifiable toVertex, MutableEdge edge, boolean bidirectional)
-
upgradeIncomingEdge
public void upgradeIncomingEdge(Identifiable toVertex, RID fromVertexRID, RID edgeRID)
-
newEdges
public List<Edge> newEdges(VertexInternal sourceVertex, List<GraphEngine.CreateEdgeOperation> connections, boolean bidirectional)
-
connectIncomingEdge
public void connectIncomingEdge(Identifiable toVertex, RID fromVertexRID, RID edgeRID)
-
createInEdgeChunk
public EdgeSegment createInEdgeChunk(MutableVertex toVertex)
-
createOutEdgeChunk
public EdgeSegment createOutEdgeChunk(MutableVertex fromVertex)
-
countEdges
public long countEdges(VertexInternal vertex, Vertex.DIRECTION direction, String edgeType)
-
deleteEdge
public void deleteEdge(Edge edge)
-
deleteVertex
public void deleteVertex(VertexInternal vertex)
-
getEdges
public Iterable<Edge> getEdges(VertexInternal vertex)
-
getEdges
public Iterable<Edge> getEdges(VertexInternal vertex, Vertex.DIRECTION direction, String... edgeTypes)
-
getVertices
public Iterable<Vertex> getVertices(VertexInternal vertex)
Returns all the connected vertices, both directions, any edge type.- Returns:
- An iterator of PVertex instances
-
getVertices
public Iterable<Vertex> getVertices(VertexInternal vertex, Vertex.DIRECTION direction, String... edgeTypes)
Returns the connected vertices.- Parameters:
direction
- Direction between OUT, IN or BOTHedgeTypes
- Edge type names to filter- Returns:
- An iterator of PVertex instances
-
isVertexConnectedTo
public boolean isVertexConnectedTo(VertexInternal vertex, Identifiable toVertex)
-
isVertexConnectedTo
public boolean isVertexConnectedTo(VertexInternal vertex, Identifiable toVertex, Vertex.DIRECTION direction)
-
isVertexConnectedTo
public boolean isVertexConnectedTo(VertexInternal vertex, Identifiable toVertex, Vertex.DIRECTION direction, String edgeType)
-
getEdgesBucketName
public String getEdgesBucketName(int bucketId, Vertex.DIRECTION direction)
-
setProperties
public static void setProperties(MutableDocument edge, Object[] properties)
-
getEdgeHeadChunk
public EdgeLinkedList getEdgeHeadChunk(VertexInternal vertex, Vertex.DIRECTION direction)
-
checkVertices
public Map<String,Object> checkVertices(String typeName, boolean fix, int verboseLevel)
-
-