Ejemplo n.º 1
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);
                }
            }
        }
Ejemplo n.º 2
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);
				}
			}
		}