Changeset View
Changeset View
Standalone View
Standalone View
java/src/main/java/org/softwareheritage/graph/server/Endpoint.java
Show All 21 Lines | public class Endpoint { | ||||
/** Internal traversal API */ | /** Internal traversal API */ | ||||
Traversal traversal; | Traversal traversal; | ||||
/** | /** | ||||
* Constructor. | * Constructor. | ||||
* | * | ||||
* @param graph the graph used for traversal endpoint | * @param graph the graph used for traversal endpoint | ||||
* @param direction a string (either "forward" or "backward") specifying edge orientation | * @param direction a string (either "forward" or "backward") specifying edge orientation | ||||
* @param edgesFmt a formatted string describing <a | * @param edgesFmt a formatted string describing <a href= | ||||
* href="https://docs.softwareheritage.org/devel/swh-graph/api.html#terminology">allowed edges</a> | * "https://docs.softwareheritage.org/devel/swh-graph/api.html#terminology">allowed | ||||
* edges</a> | |||||
*/ | */ | ||||
public Endpoint(Graph graph, String direction, String edgesFmt) { | public Endpoint(Graph graph, String direction, String edgesFmt) { | ||||
this.graph = graph; | this.graph = graph; | ||||
this.traversal = new Traversal(graph, direction, edgesFmt); | this.traversal = new Traversal(graph, direction, edgesFmt); | ||||
} | } | ||||
/** | /** | ||||
* Converts a list of (internal) long node ids to a list of corresponding (external) SWHIDs. | * Converts a list of (internal) long node ids to a list of corresponding (external) SWHIDs. | ||||
▲ Show 20 Lines • Show All 201 Lines • ▼ Show 20 Lines | public class Endpoint { | ||||
/** | /** | ||||
* Wrapper class to unify traversal methods input signatures. | * Wrapper class to unify traversal methods input signatures. | ||||
*/ | */ | ||||
public static class Input { | public static class Input { | ||||
/** Source node of endpoint call specified as a {@link SWHID} */ | /** Source node of endpoint call specified as a {@link SWHID} */ | ||||
public SWHID src; | public SWHID src; | ||||
/** | /** | ||||
* Destination formatted string as described in the <a | * Destination formatted string as described in the | ||||
* href="https://docs.softwareheritage.org/devel/swh-graph/api.html#walk">API</a> | * <a href="https://docs.softwareheritage.org/devel/swh-graph/api.html#walk">API</a> | ||||
*/ | */ | ||||
public String dstFmt; | public String dstFmt; | ||||
/** Traversal algorithm used in endpoint call (either "dfs" or "bfs") */ | /** Traversal algorithm used in endpoint call (either "dfs" or "bfs") */ | ||||
public String algorithm; | public String algorithm; | ||||
public Input(SWHID src) { | public Input(SWHID src) { | ||||
this.src = src; | this.src = src; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 50 Lines • Show Last 20 Lines |