/// <inheritdoc />
 public override bool AddEdge(ReplaceableVertexFactoryInterface <TEdgeData> vertexFactory,
                              int destVertexIndex,
                              TEdgeData edgeData,
                              out ReplaceableVertexAdjacency <TEdgeData> final)
 {
     final = vertexFactory.GetInstance(EnumerableExtensions.Enumerate(AdjacentEdge.Create(destVertexIndex, edgeData)), 1);
     return(true);
 }
示例#2
0
        /// <inheritdoc />
        public override IEnumerator <AdjacentEdge <TEdgeData> > GetEnumerator()
        {
            yield return(AdjacentEdge.Create(_destVertexIndex1, _edgeData1));

            yield return(AdjacentEdge.Create(_destVertexIndex2, _edgeData2));

            yield return(AdjacentEdge.Create(_destVertexIndex3, _edgeData3));
        }
示例#3
0
        /// <inheritdoc />
        public override bool AddEdge(ReplaceableVertexFactoryInterface <TEdgeData> vertexFactory,
                                     int destVertexIndex,
                                     TEdgeData edgeData,
                                     out ReplaceableVertexAdjacency <TEdgeData> final)
        {
            if (ContainsEdgeToIndex(destVertexIndex))
            {
                final = this;
                return(false);
            }

            final = vertexFactory.GetInstance(
                this.Append(AdjacentEdge.Create(destVertexIndex, edgeData)), EdgesCount + 1);
            return(true);
        }
 /// <inheritdoc />
 public VertexAdjacency <TEdgeData> GetInstance(IEnumerable <AdjacentEdge <TEdgeData> > edgesTo, int edgesCount)
 {
     return(_wrapped.GetInstance(edgesTo.Select(e => AdjacentEdge.Create(_translator.GetDestIndex(e.Destination), e.Data)),
                                 edgesCount));
 }
 private AdjacentEdge <TEdgeData> ReplaceData(AdjacentEdge <TEdgeData> source)
 {
     return(AdjacentEdge.Create(source.Destination, _copyEdgeDataCallback(source)));
 }