Aritalab:Lecture/Programming/Java/Graph/Edge
From Metabolomics.JP
< Aritalab:Lecture | Programming | Java | Graph(Difference between revisions)
(Created page with "==グラフ辺のリスト構造== グラフ辺は二重リンクリストの要素として実現します。 <pre> public class GraphEdge extends ListRep { protected int...") |
m |
||
| Line 3: | Line 3: | ||
<pre> | <pre> | ||
| − | public class GraphEdge extends | + | public class GraphEdge extends ListEntry |
{ | { | ||
protected int e_id = 0; | protected int e_id = 0; | ||
Latest revision as of 10:05, 28 April 2011
[edit] グラフ辺のリスト構造
グラフ辺は二重リンクリストの要素として実現します。
public class GraphEdge extends ListEntry
{
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];
}
}