Backend API

public class Edge

Visually, an edge is a link between two nodes. An edge is a part of the flow. The notion is described in the Flow-based programming paradigm.

Created by antoine on 29/05/17.

public String getId ()

Give the unique id of the edge

public JSONObject getSrc ()

Give the source element of the edge.

As described in the FBP Network Protocol, the source element is composed of : - The node id - The port of the node the edge is connected to

public void setSrc (JSONObject src)

Set the source element of the edge.

As described in the FBP Network Protocol, the source element is composed of : - The node id - The port of the node the edge is connected to

public void setTgt (JSONObject tgt)

Set the target element of the edge.

As described in the FBP Network Protocol, the target element is composed of : - The node id - The port of the node the edge is connected to

public JSONObject getMetadata ()

Give the metadata of the edhe

public void setMetadata(JSONObject metadata)

Replace the metadata of the edge with the given one

public String getGraph ()

Give the graph id on which the edge is.

public JSONObject getJson()

Give the JSONObject representing a node. The JSON has the following structure : { ‘id’: string, ‘src’: object, ‘tgt’: object, ‘metadata’: object, ‘graph’: string }

private void build ()

Build the JSONObject of the edge.

The JSON has the following structure : { ‘id’: string, ‘src’: object, ‘tgt’: object, ‘metadata’: object, ‘graph’: string }