Aritalab:Lecture/Programming/Java/Graph/Edge
From Metabolomics.JP
< Aritalab:Lecture | Programming | Java | Graph
グラフ辺のリスト構造
グラフ辺は二重リンクリストの要素として実現します。
public class GraphEdge extends ListRep
{
protected int e_id = 0;
protected Graph owner = null;
protected GraphEdge[] succ_inout_edge = new GraphEdge[2];
protected GraphEdge[] pred_inout_edge = new GraphEdge[2];
protected GraphNode source = null;
protected GraphNode target = null;
public GraphEdge(GraphNode v, GraphNode w)
{
init(v, w, new EdgeData());
}
public GraphEdge(GraphNode v, GraphNode w, EdgeData ed)
{
init(v, w, ed);
}
protected GraphEdge succ_in_edge()
{
return succ_inout_edge[0];
}
protected GraphEdge succ_out_edge()
{
return succ_inout_edge[1];
}
protected GraphEdge pred_in_edge()
{
return pred_inout_edge[0];
}
protected GraphEdge pred_out_edge()
{
return pred_inout_edge[1];
}
}