コード例 #1
0
ファイル: Graph.cs プロジェクト: orf53975/hadoop.net
 public virtual Graph.Node AddEdge(Graph.Node to, string info)
 {
     Graph.Edge e = new Graph.Edge(this, this, to, info);
     this.outs.AddItem(e);
     to.ins.AddItem(e);
     return(this);
 }
コード例 #2
0
ファイル: Graph.cs プロジェクト: orf53975/hadoop.net
 public virtual bool SameAs(Graph.Edge rhs)
 {
     if (this.from == rhs.from && this.to == rhs.to)
     {
         return(true);
     }
     return(false);
 }
コード例 #3
0
ファイル: Graph.cs プロジェクト: orf53975/hadoop.net
        public static IList <Graph.Edge> CombineEdges(IList <Graph.Edge> edges)
        {
            IList <Graph.Edge> ret = new AList <Graph.Edge>();

            foreach (Graph.Edge edge in edges)
            {
                bool found = false;
                for (int i = 0; i < ret.Count; i++)
                {
                    Graph.Edge current = ret[i];
                    if (edge.SameAs(current))
                    {
                        ret.Set(i, current.Combine(edge));
                        found = true;
                        break;
                    }
                }
                if (!found)
                {
                    ret.AddItem(edge);
                }
            }
            return(ret);
        }
コード例 #4
0
ファイル: Graph.cs プロジェクト: orf53975/hadoop.net
            public virtual Graph.Edge Combine(Graph.Edge rhs)
            {
                string newlabel = this.label + "," + rhs.label;

                return(new Graph.Edge(this, this.from, this.to, newlabel));
            }