예제 #1
0
        public IEdge AddEdge(object id, IVertex outVertex, IVertex inVertex, string label)
        {
            GraphContract.ValidateAddEdge(id, outVertex, inVertex, label);

            var edge = new PartitionEdge(BaseGraph.AddEdge(id,
                                                           ((PartitionVertex)outVertex).Vertex,
                                                           ((PartitionVertex)inVertex).Vertex,
                                                           label),
                                         this);

            edge.SetPartition(_writePartition);
            return(edge);
        }
            private bool HasNext()
            {
                if (null != _nextEdge)
                {
                    return(true);
                }

                while (_itty.MoveNext())
                {
                    var edge = _itty.Current;
                    if (_partitionEdgeIterable._graph.IsInPartition(edge))
                    {
                        _nextEdge = new PartitionEdge(edge, _partitionEdgeIterable._graph);
                        return(true);
                    }
                }
                return(false);
            }
 public IEnumerator <IEdge> GetEnumerator()
 {
     while (HasNext())
     {
         if (null != _nextEdge)
         {
             var temp = _nextEdge;
             _nextEdge = null;
             yield return(temp);
         }
         else
         {
             while (_itty.MoveNext())
             {
                 var edge = _itty.Current;
                 if (_partitionEdgeIterable._graph.IsInPartition(edge))
                 {
                     yield return(new PartitionEdge(edge, _partitionEdgeIterable._graph));
                 }
             }
         }
     }
 }