@Test public void testGetPredecessors() throws Exception { List<Edge> predecessors = Lists.newArrayList(QUERY_HANDLER.getPredecessors( GDL_HANDLER.getEdgeCache().get("e2").getId())); List<Edge> expected = Lists.newArrayList( GDL_HANDLER.getEdgeCache().get("e1")); assertTrue(elementsEqual(predecessors, expected)); }
public Collection<Edge> getPredecessors(Long edgeId) { Collection<Edge> predecessors = getEdgesByTargetVertexId(getEdgeById(edgeId).getSourceVertexId()); return predecessors != null ? Lists.newArrayList(predecessors) : Lists.newArrayList(); }
QueryHandler { public Collection<Edge> getPredecessors(Long edgeId) { Collection<Edge> predecessors = getEdgesByTargetVertexId(getEdgeById(edgeId).getSourceVertexId()); return predecessors != null ? Lists.newArrayList(predecessors) : Lists.newArrayList(); } }
QueryHandler { public Collection<Edge> getPredecessors(Long edgeId) { Collection<Edge> predecessors = getEdgesByTargetVertexId(getEdgeById(edgeId).getSourceVertexId()); return predecessors != null ? Lists.newArrayList(predecessors) : Lists.newArrayList(); } QueryHandler(String gdlString); }
QueryHandler { public Collection<Edge> getPredecessors(Long edgeId) { Collection<Edge> predecessors = getEdgesByTargetVertexId(getEdgeById(edgeId).getSourceVertexId()); return predecessors != null ? Lists.newArrayList(predecessors) : Lists.newArrayList(); } QueryHandler(String gdlString); Collection<Vertex> getVertices(); Collection<Edge> getEdges(); Collection<Triple> getTriples(); Set<String> getAllVariables(); Set<String> getVertexVariables(); Set<String> getEdgeVariables(); CNF getPredicates(); int getVertexCount(); int getEdgeCount(); boolean isSingleVertexGraph(); int getDiameter(); int getRadius(); Map<Integer, Set<String>> getComponents(); boolean isVertex(String variable); boolean isEdge(String variable); Vertex getVertexById(Long id); Edge getEdgeById(Long id); Vertex getVertexByVariable(String variable); Edge getEdgeByVariable(String variable); Collection<Vertex> getVerticesByLabel(String label); Collection<Edge> getEdgesByLabel(String label); Collection<Edge> getEdgesByVertexId(Long vertexId); Collection<Edge> getEdgesBySourceVertexId(Long vertexId); Collection<Long> getEdgeIdsBySourceVertexId(Long vertexId); Collection<Edge> getEdgesByTargetVertexId(Long vertexId); Collection<Long> getEdgeIdsByTargetVertexId(Long vertexId); Collection<Edge> getPredecessors(Long edgeId); Collection<Edge> getSuccessors(Long edgeId); Collection<Long> getPredecessorIds(Long edgeId); Collection<Long> getSuccessorIds(Long edgeId); Collection<Vertex> getNeighbors(Long vertexId); Collection<Long> getNeighborIds(Long vertexId); Map<String, String> getLabelsForVariables(Collection<String> variables); Map<String, Pair<String, String>> getSourceTargetVariables(); Collection<Vertex> getCenterVertices(); Vertex getCenterVertex(); Collection<Long> getCentralVertexIds(); void updateGeneratedVariableNames(Function<String, String> renameFunction); }
QueryHandler { public Collection<Edge> getPredecessors(Long edgeId) { Collection<Edge> predecessors = getEdgesByTargetVertexId(getEdgeById(edgeId).getSourceVertexId()); return predecessors != null ? Lists.newArrayList(predecessors) : Lists.newArrayList(); } QueryHandler(String gdlString); Collection<Vertex> getVertices(); Collection<Edge> getEdges(); Collection<Triple> getTriples(); Set<String> getAllVariables(); Set<String> getVertexVariables(); Set<String> getEdgeVariables(); CNF getPredicates(); int getVertexCount(); int getEdgeCount(); boolean isSingleVertexGraph(); int getDiameter(); int getRadius(); Map<Integer, Set<String>> getComponents(); boolean isVertex(String variable); boolean isEdge(String variable); Vertex getVertexById(Long id); Edge getEdgeById(Long id); Vertex getVertexByVariable(String variable); Edge getEdgeByVariable(String variable); Collection<Vertex> getVerticesByLabel(String label); Collection<Edge> getEdgesByLabel(String label); Collection<Edge> getEdgesByVertexId(Long vertexId); Collection<Edge> getEdgesBySourceVertexId(Long vertexId); Collection<Long> getEdgeIdsBySourceVertexId(Long vertexId); Collection<Edge> getEdgesByTargetVertexId(Long vertexId); Collection<Long> getEdgeIdsByTargetVertexId(Long vertexId); Collection<Edge> getPredecessors(Long edgeId); Collection<Edge> getSuccessors(Long edgeId); Collection<Long> getPredecessorIds(Long edgeId); Collection<Long> getSuccessorIds(Long edgeId); Collection<Vertex> getNeighbors(Long vertexId); Collection<Long> getNeighborIds(Long vertexId); Map<String, String> getLabelsForVariables(Collection<String> variables); Map<String, Pair<String, String>> getSourceTargetVariables(); Collection<Vertex> getCenterVertices(); Vertex getCenterVertex(); Collection<Long> getCentralVertexIds(); void updateGeneratedVariableNames(Function<String, String> renameFunction);  }