Changeset View
Changeset View
Standalone View
Standalone View
java/src/main/java/org/softwareheritage/graph/Entry.java
Show First 20 Lines • Show All 120 Lines • ▼ Show 20 Lines | public class QueryHandler { | ||||
public void neighbors(String direction, String edgesFmt, long srcNodeId) { | public void neighbors(String direction, String edgesFmt, long srcNodeId) { | ||||
open(); | open(); | ||||
Traversal t = new Traversal(this.graph, direction, edgesFmt); | Traversal t = new Traversal(this.graph, direction, edgesFmt); | ||||
t.neighborsVisitor(srcNodeId, this::writeNode); | t.neighborsVisitor(srcNodeId, this::writeNode); | ||||
close(); | close(); | ||||
} | } | ||||
public void visit_nodes(String direction, String edgesFmt, long srcNodeId) { | public void visit_nodes(String direction, String edgesFmt, long srcNodeId, Object max_edges) { | ||||
open(); | open(); | ||||
Traversal t = new Traversal(this.graph, direction, edgesFmt); | Traversal t = new Traversal(this.graph, direction, edgesFmt); | ||||
t.visitNodesVisitor(srcNodeId, this::writeNode); | t.visitNodesVisitor(srcNodeId, this::writeNode, max_edges); | ||||
close(); | close(); | ||||
} | } | ||||
public void visit_edges(String direction, String edgesFmt, long srcNodeId) { | public void visit_edges(String direction, String edgesFmt, long srcNodeId, Object max_edges) { | ||||
open(); | open(); | ||||
Traversal t = new Traversal(this.graph, direction, edgesFmt); | Traversal t = new Traversal(this.graph, direction, edgesFmt); | ||||
t.visitNodesVisitor(srcNodeId, null, this::writeEdge); | t.visitNodesVisitor(srcNodeId, null, this::writeEdge, max_edges, false); | ||||
close(); | close(); | ||||
} | } | ||||
public void visit_paths(String direction, String edgesFmt, long srcNodeId) { | public void visit_paths(String direction, String edgesFmt, long srcNodeId, Object max_edges) { | ||||
open(); | open(); | ||||
Traversal t = new Traversal(this.graph, direction, edgesFmt); | Traversal t = new Traversal(this.graph, direction, edgesFmt); | ||||
t.visitPathsVisitor(srcNodeId, this::writePath); | t.visitPathsVisitor(srcNodeId, this::writePath, max_edges); | ||||
close(); | close(); | ||||
} | } | ||||
public void walk(String direction, String edgesFmt, String algorithm, long srcNodeId, long dstNodeId) { | public void walk(String direction, String edgesFmt, String algorithm, long srcNodeId, long dstNodeId) { | ||||
open(); | open(); | ||||
Traversal t = new Traversal(this.graph, direction, edgesFmt); | Traversal t = new Traversal(this.graph, direction, edgesFmt); | ||||
for (Long nodeId : t.walk(srcNodeId, dstNodeId, algorithm)) { | for (Long nodeId : t.walk(srcNodeId, dstNodeId, algorithm)) { | ||||
writeNode(nodeId); | writeNode(nodeId); | ||||
Show All 34 Lines |