Package org.codehaus.plexus.graph.domain.basic

Examples of org.codehaus.plexus.graph.domain.basic.DefaultDirectedGraph


    public DirectedGraph transpose()
        throws GraphException
    {
        try
        {
            DefaultDirectedGraph RC = new DefaultDirectedGraph();
            Set vertexSet = getVertices();
            Set edgeSet = getEdges();

            Iterator vertices = vertexSet.iterator();
            while ( vertices.hasNext() )
            {
                RC.addVertex( (Vertex) vertices.next() );
            }

            Iterator edges = edgeSet.iterator();
            while ( edges.hasNext() )
            {
                Edge edge = (Edge) edges.next();

                RC.addEdge( edge, getTarget( edge ), getSource( edge ) );
            }

            return RC;
        }
        catch ( GraphException e )
View Full Code Here


    public DirectedGraph makeDirectedGraph( Contract contracts[],
                                            boolean isWeighted,
                                            DirectedGraph graph )
        throws GraphException
    {
        DefaultDirectedGraph dgi = null;

        if ( graph != null )
        {
            dgi = new DefaultDirectedGraph( graph );
        }
        else
        {
            dgi = new DefaultDirectedGraph();
        }

        for ( int i = 0; i < contracts.length; i++ )
        {
            dgi.addContract( contracts[i] );
        }

        return (DirectedGraph) makeGraph( contracts, dgi, org.codehaus.plexus.graph.DirectedGraph.class, isWeighted );
    }
View Full Code Here

                                                          boolean isWeighted,
                                                          DirectedGraph graph )
        throws GraphException
    {

        DefaultDirectedGraph dgi = null;

        if ( graph != null )
        {
            dgi = new DefaultDirectedGraph( graph );
        }
        else
        {
            dgi = new DefaultDirectedGraph();
        }

        for ( int i = 0; i < contracts.length; i++ )
        {
            dgi.addContract( contracts[i] );
        }

        return (MutableDirectedGraph) makeGraph( contracts, dgi, org.codehaus.plexus.graph.MutableDirectedGraph.class,
                                                 isWeighted );
    }
View Full Code Here

TOP

Related Classes of org.codehaus.plexus.graph.domain.basic.DefaultDirectedGraph

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.