Example #1
0
        /// <summary> Construct a new pseudograph. The pseudograph can either be directed or
        /// undirected, depending on the specified edge factory. A sample edge is
        /// created using the edge factory to see if the factory is compatible with
        /// this class of  graph. For example, if this graph is a
        /// <code>DirectedGraph</code> the edge factory must produce
        /// <code>DirectedEdge</code>s. If this is not the case, an
        /// <code>IllegalArgumentException</code> is thrown.
        ///
        /// </summary>
        /// <param name="ef">the edge factory of the new graph.
        /// </param>
        /// <param name="allowMultipleEdges">whether to allow multiple edges or not.
        /// </param>
        /// <param name="allowLoops">whether to allow edges that are self-loops or not.
        ///
        /// </param>
        /// <throws>  NullPointerException if the specified edge factory is </throws>
        /// <summary>         <code>null</code>.
        /// </summary>
        public AbstractBaseGraph(EdgeFactory ef, bool allowMultipleEdges, bool allowLoops)
        {
            if (ef == null)
            {
                throw new System.NullReferenceException();
            }

            m_vertexMap             = new SupportClass.HashSetSupport();
            m_edgeSet               = new SupportClass.HashSetSupport();
            m_edgeFactory           = ef;
            m_allowingLoops         = allowLoops;
            m_allowingMultipleEdges = allowMultipleEdges;

            m_specifics = createSpecifics();

            Edge e = ef.createEdge(new System.Object(), new System.Object());

            m_factoryEdgeClass = e.GetType();

            m_edgeListFactory = new ArrayListFactory();

            m_unmodifiableEdgeSet   = null;
            m_unmodifiableVertexSet = null;
        }
Example #2
0
 internal UndirectedEdgeContainer(EdgeListFactory edgeListFactory, System.Object vertex)
 {
     m_vertexEdges = edgeListFactory.createEdgeList(vertex);
 }
Example #3
0
 internal DirectedEdgeContainer(EdgeListFactory edgeListFactory, System.Object vertex)
 {
     m_incoming = edgeListFactory.createEdgeList(vertex);
     m_outgoing = edgeListFactory.createEdgeList(vertex);
 }
			internal DirectedEdgeContainer(EdgeListFactory edgeListFactory, System.Object vertex)
			{
				m_incoming = edgeListFactory.createEdgeList(vertex);
				m_outgoing = edgeListFactory.createEdgeList(vertex);
			}
		/// <summary> Construct a new pseudograph. The pseudograph can either be directed or
		/// undirected, depending on the specified edge factory. A sample edge is
		/// created using the edge factory to see if the factory is compatible with
		/// this class of  graph. For example, if this graph is a
		/// <code>DirectedGraph</code> the edge factory must produce
		/// <code>DirectedEdge</code>s. If this is not the case, an
		/// <code>IllegalArgumentException</code> is thrown.
		/// 
		/// </summary>
		/// <param name="ef">the edge factory of the new graph.
		/// </param>
		/// <param name="allowMultipleEdges">whether to allow multiple edges or not.
		/// </param>
		/// <param name="allowLoops">whether to allow edges that are self-loops or not.
		/// 
		/// </param>
		/// <throws>  NullPointerException if the specified edge factory is </throws>
		/// <summary>         <code>null</code>.
		/// </summary>
		public AbstractBaseGraph(EdgeFactory ef, bool allowMultipleEdges, bool allowLoops)
		{
			if (ef == null)
			{
				throw new System.NullReferenceException();
			}

            m_vertexMap = new SupportClass.HashSetSupport();
            m_edgeSet = new SupportClass.HashSetSupport();
			m_edgeFactory = ef;
			m_allowingLoops = allowLoops;
			m_allowingMultipleEdges = allowMultipleEdges;
			
			m_specifics = createSpecifics();
			
			Edge e = ef.createEdge(new System.Object(), new System.Object());
			m_factoryEdgeClass = e.GetType();
			
			m_edgeListFactory = new ArrayListFactory();

            m_unmodifiableEdgeSet = null;
            m_unmodifiableVertexSet = null;
		}
			internal UndirectedEdgeContainer(EdgeListFactory edgeListFactory, System.Object vertex)
			{
				m_vertexEdges = edgeListFactory.createEdgeList(vertex);
			}