1 package eu.ehri.project.acl.wrapper; 2 3 import com.tinkerpop.blueprints.Direction; 4 import com.tinkerpop.blueprints.Edge; 5 import com.tinkerpop.blueprints.Vertex; 6 import com.tinkerpop.blueprints.VertexQuery; 7 import com.tinkerpop.blueprints.util.wrappers.WrapperVertexQuery; 8 9 10 public class AclVertex extends AclElement implements Vertex { 11 12 protected AclVertex(Vertex baseVertex, AclGraph<?> aclGraph) { 13 super(baseVertex, aclGraph); 14 } 15 16 @Override 17 public Iterable<Edge> getEdges(Direction direction, String... strings) { 18 return new AclEdgeIterable(((Vertex) this.baseElement).getEdges(direction, strings), aclGraph); 19 } 20 21 @Override 22 public Iterable<Vertex> getVertices(Direction direction, String... strings) { 23 return new AclVertexIterable(((Vertex) this.baseElement).getVertices(direction, strings), aclGraph); 24 } 25 26 @Override 27 public VertexQuery query() { 28 return new WrapperVertexQuery(((Vertex) this.baseElement).query()) { 29 @Override 30 public Iterable<Vertex> vertices() { 31 return new AclVertexIterable(this.query.vertices(), aclGraph); 32 } 33 34 @Override 35 public Iterable<Edge> edges() { 36 return this.query.edges(); 37 } 38 }; 39 } 40 41 @Override 42 public Edge addEdge(String label, Vertex vertex) { 43 return aclGraph.addEdge(null, this, vertex, label); 44 } 45 46 public Vertex getBaseVertex() { 47 return (Vertex) this.baseElement; 48 } 49 50 @Override 51 public String toString() { 52 return "aclvertex(" + aclGraph.getAccessor().getId() + ")[" + getBaseVertex() + "]"; 53 } 54 }