Exemplo n.º 1
0
        /// <summary> {@inheritDoc}</summary>
        public virtual void  generateGraph(Graph target, VertexFactory vertexFactory, System.Collections.IDictionary resultMap)
        {
            System.Object lastVertex = null;

            for (int i = 0; i < m_size; ++i)
            {
                System.Object newVertex = vertexFactory.createVertex();
                target.addVertex(newVertex);

                if (lastVertex == null)
                {
                    if (resultMap != null)
                    {
                        resultMap[START_VERTEX] = newVertex;
                    }
                }
                else
                {
                    target.addEdge(lastVertex, newVertex);
                }

                lastVertex = newVertex;
            }

            if ((resultMap != null) && (lastVertex != null))
            {
                resultMap[END_VERTEX] = lastVertex;
            }
        }
Exemplo n.º 2
0
 /// <summary> {@inheritDoc}</summary>
 public virtual void  generateGraph(Graph target, VertexFactory vertexFactory, System.Collections.IDictionary resultMap)
 {
     for (int i = 0; i < m_size; ++i)
     {
         target.addVertex(vertexFactory.createVertex());
     }
 }
		/// <summary> {@inheritDoc}</summary>
		public virtual void  generateGraph(Graph target, VertexFactory vertexFactory, System.Collections.IDictionary resultMap)
		{
			System.Object lastVertex = null;
			
			for (int i = 0; i < m_size; ++i)
			{
				System.Object newVertex = vertexFactory.createVertex();
				target.addVertex(newVertex);
				
				if (lastVertex == null)
				{
					if (resultMap != null)
					{
						resultMap[START_VERTEX] = newVertex;
					}
				}
				else
				{
					target.addEdge(lastVertex, newVertex);
				}
				
				lastVertex = newVertex;
			}
			
			if ((resultMap != null) && (lastVertex != null))
			{
				resultMap[END_VERTEX] = lastVertex;
			}
		}
Exemplo n.º 4
0
		/// <summary> {@inheritDoc}</summary>
		public virtual void  generateGraph(Graph target, VertexFactory vertexFactory, System.Collections.IDictionary resultMap)
		{
			if (m_size < 1)
			{
				return ;
			}
			
			LinearGraphGenerator linearGenerator = new LinearGraphGenerator(m_size);
			//UPGRADE_TODO: Class 'java.util.HashMap' was converted to 'System.Collections.Hashtable' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilHashMap'"
			System.Collections.IDictionary privateMap = new System.Collections.Hashtable();
			linearGenerator.generateGraph(target, vertexFactory, privateMap);
			
			System.Object startVertex = privateMap[LinearGraphGenerator.START_VERTEX];
			System.Object endVertex = privateMap[LinearGraphGenerator.END_VERTEX];
			target.addEdge(endVertex, startVertex);
		}
Exemplo n.º 5
0
        /// <summary> {@inheritDoc}</summary>
        public virtual void  generateGraph(Graph target, VertexFactory vertexFactory, System.Collections.IDictionary resultMap)
        {
            if (m_size < 1)
            {
                return;
            }

            LinearGraphGenerator linearGenerator = new LinearGraphGenerator(m_size);

            //UPGRADE_TODO: Class 'java.util.HashMap' was converted to 'System.Collections.Hashtable' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilHashMap'"
            System.Collections.IDictionary privateMap = new System.Collections.Hashtable();
            linearGenerator.generateGraph(target, vertexFactory, privateMap);

            System.Object startVertex = privateMap[LinearGraphGenerator.START_VERTEX];
            System.Object endVertex   = privateMap[LinearGraphGenerator.END_VERTEX];
            target.addEdge(endVertex, startVertex);
        }
Exemplo n.º 6
0
        /// <summary> {@inheritDoc}</summary>
        public virtual void  generateGraph(Graph target, VertexFactory vertexFactory, System.Collections.IDictionary resultMap)
        {
            if (m_size < 1)
            {
                return;
            }

            // A little trickery to intercept the rim generation.  This is
            // necessary since target may be initially non-empty, meaning we can't
            // rely on its vertex set after the rim is generated.
            //UPGRADE_NOTE: Final was removed from the declaration of 'rim '. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'"
            System.Collections.ICollection rim = new System.Collections.ArrayList();
            VertexFactory rimVertexFactory     = new AnonymousClassVertexFactory(vertexFactory, rim, this);

            RingGraphGenerator ringGenerator = new RingGraphGenerator(m_size - 1);

            ringGenerator.generateGraph(target, rimVertexFactory, resultMap);

            System.Object hubVertex = vertexFactory.createVertex();
            target.addVertex(hubVertex);

            if (resultMap != null)
            {
                resultMap[HUB_VERTEX] = hubVertex;
            }

            System.Collections.IEnumerator rimIter = rim.GetEnumerator();

            //UPGRADE_TODO: Method 'java.util.Iterator.hasNext' was converted to 'System.Collections.IEnumerator.MoveNext' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratorhasNext'"
            while (rimIter.MoveNext())
            {
                //UPGRADE_TODO: Method 'java.util.Iterator.next' was converted to 'System.Collections.IEnumerator.Current' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratornext'"
                System.Object rimVertex = rimIter.Current;

                if (m_inwardSpokes)
                {
                    target.addEdge(rimVertex, hubVertex);
                }
                else
                {
                    target.addEdge(hubVertex, rimVertex);
                }
            }
        }
		/// <summary> {@inheritDoc}</summary>
		public virtual void  generateGraph(Graph target, VertexFactory vertexFactory, System.Collections.IDictionary resultMap)
		{
			if (m_size < 1)
			{
				return ;
			}
			
			// A little trickery to intercept the rim generation.  This is
			// necessary since target may be initially non-empty, meaning we can't
			// rely on its vertex set after the rim is generated.
			//UPGRADE_NOTE: Final was removed from the declaration of 'rim '. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'"
			System.Collections.ICollection rim = new System.Collections.ArrayList();
			VertexFactory rimVertexFactory = new AnonymousClassVertexFactory(vertexFactory, rim, this);
			
			RingGraphGenerator ringGenerator = new RingGraphGenerator(m_size - 1);
			ringGenerator.generateGraph(target, rimVertexFactory, resultMap);
			
			System.Object hubVertex = vertexFactory.createVertex();
			target.addVertex(hubVertex);
			
			if (resultMap != null)
			{
				resultMap[HUB_VERTEX] = hubVertex;
			}
			
			System.Collections.IEnumerator rimIter = rim.GetEnumerator();
			
			//UPGRADE_TODO: Method 'java.util.Iterator.hasNext' was converted to 'System.Collections.IEnumerator.MoveNext' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratorhasNext'"
			while (rimIter.MoveNext())
			{
				//UPGRADE_TODO: Method 'java.util.Iterator.next' was converted to 'System.Collections.IEnumerator.Current' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratornext'"
				System.Object rimVertex = rimIter.Current;
				
				if (m_inwardSpokes)
				{
					target.addEdge(rimVertex, hubVertex);
				}
				else
				{
					target.addEdge(hubVertex, rimVertex);
				}
			}
		}