Exemple #1
0
        public IVertex AddVertex(object id)
        {
            var vertex = new PartitionVertex(BaseGraph.AddVertex(id), this);

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

                while (_itty.MoveNext())
                {
                    var vertex = _itty.Current;
                    if (_partitionVertexIterable._graph.IsInPartition(vertex))
                    {
                        _nextVertex = new PartitionVertex(vertex, _partitionVertexIterable._graph);
                        return(true);
                    }
                }
                return(false);
            }
 public IEnumerator <IVertex> GetEnumerator()
 {
     while (HasNext())
     {
         if (null != _nextVertex)
         {
             var temp = _nextVertex;
             _nextVertex = null;
             yield return(temp);
         }
         else
         {
             while (_itty.MoveNext())
             {
                 var vertex = _itty.Current;
                 if (_partitionVertexIterable._graph.IsInPartition(vertex))
                 {
                     yield return(new PartitionVertex(vertex, _partitionVertexIterable._graph));
                 }
             }
         }
     }
 }