コード例 #1
0
 @Override
 public BinaryEdge createEdge(Vertex startVertex, Vertex endVertex) {
   return new BinaryEdgeImpl(
       db,
       startVertex
           .getNode()
           .createRelationshipTo(endVertex.getNode(), this.getRelationshipType())
           .getId());
 }
コード例 #2
0
 @Override
 public BinaryEdge getSingleBinaryEdge(Vertex vertex, Direction dir) {
   Relationship rel = vertex.getNode().getSingleRelationship(getRelationshipType(), dir);
   if (rel == null) {
     return null;
   } else {
     return new BinaryEdgeImpl(db, rel.getId());
   }
 }
コード例 #3
0
 @Override
 public boolean hasEdge(Vertex vertex) {
   return vertex.getNode().hasRelationship(getRelationshipType());
 }
コード例 #4
0
 @Override
 public boolean hasEdge(Vertex vertex, Direction dir) {
   return vertex.getNode().hasRelationship(getRelationshipType(), dir);
 }
コード例 #5
0
 @Override
 public Iterable<BinaryEdge> getEdges(Vertex vertex, Direction dir) {
   return new RelationshipIterable(
       vertex.getNode().getRelationships(this.getRelationshipType(), dir));
 }