Class ComponentGroupMultiGraph

  • All Implemented Interfaces:
    edu.uci.ics.jung.graph.Graph, edu.uci.ics.jung.graph.Hypergraph

    public class ComponentGroupMultiGraph
    extends java.lang.Object
    implements edu.uci.ics.jung.graph.Graph
    A generic Graph with edges and vertices consisting of groups of elements. The elements are in a container that inplements the IComponentGroup interface. (You cant use simply List because the edges and vertices are stored in HashMaps and Lists changes their hashcode when elements are added or removed. The List is no longer to be found in the HashMap) Edge- and vertex element are stored in this component while the vertices and edges are delegated to a different graph. This implementation provides acces to either the elements and (per delegate) to the vertex and edges of the graph.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected edu.uci.ics.jung.graph.Graph delegate
      The delegated graph
      protected java.util.Map edge_elemets
      The map of edge elements
      protected org.apache.commons.collections15.Factory edge_factory
      Factories for edges
      protected jadex.tools.comanalyzer.graph.ComponentGroupMultiGraph.GenericSortedList edge_weights
      The edge weights is the number of edge elements contained in the edge.
      protected java.util.Map vertex_elemets
      The map of vertex elements
      protected org.apache.commons.collections15.Factory vertex_factory
      Factoriy for vertices
      protected jadex.tools.comanalyzer.graph.ComponentGroupMultiGraph.GenericSortedList vertex_weights
      The vertex weights is the number of edges going in or out the vertex.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected ComponentGroupMultiGraph​(org.apache.commons.collections15.Factory vertex_factory, org.apache.commons.collections15.Factory edge_factory, edu.uci.ics.jung.graph.Graph delegate)
      The constructor.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean addEdge​(java.lang.Object e, java.lang.Object v1, java.lang.Object v2)
      Adds an directed edge to the graph.
      boolean addEdge​(java.lang.Object e, java.lang.Object v1, java.lang.Object v2, edu.uci.ics.jung.graph.util.EdgeType edgeType)
      Adds an edge with a given edge type to the graph.
      boolean addEdge​(java.lang.Object edge, java.util.Collection vertices)
      Adds an edge to the graph.
      boolean addEdge​(java.lang.Object edge, java.util.Collection vertices, edu.uci.ics.jung.graph.util.EdgeType edge_type)
      Adds edge to this graph with type edge_type.
      boolean addEdgeElement​(java.lang.Object ee, java.lang.Object ve1, java.lang.Object ve2)
      Adds an directed edge element with given vertex elements to the graph.
      boolean addEdgeElement​(java.lang.Object ee, java.lang.Object ve1, java.lang.Object ve2, edu.uci.ics.jung.graph.util.EdgeType edgeType)
      Adds an edge element with given vertex elements and edge type to the graph.
      boolean addVertex​(java.lang.Object vertex)
      Adds a vertex to the graph.
      boolean addVertexElement​(java.lang.Object ve)
      Adds a new vertex containing the vertex element to the graph.
      boolean appendEdgeElement​(java.lang.Object ee, java.lang.Object ve1, java.lang.Object ve2)
      Appends an directed edge element with given vertex elements to the graph.
      boolean appendEdgeElement​(java.lang.Object ee, java.lang.Object ve1, java.lang.Object ve2, edu.uci.ics.jung.graph.util.EdgeType edgeType)
      Appends an edge element with given vertex elements and edge type to the graph.
      boolean appendVertexElement​(java.lang.Object ve, java.lang.Object v)
      Append a vertex element to a vertex.
      void clear()
      Clear all elements from the delegated graph and this graph.
      boolean containsEdge​(java.lang.Object edge)
      Returns true if the graph contains the edge.
      boolean containsEdgeElement​(java.lang.Object ee)
      Returns true if the graph contains the given edge element.
      boolean containsVertex​(java.lang.Object vertex)
      Returns true if the graph contains the vertex.
      boolean containsVertexElement​(java.lang.Object ve)
      Returns true if the graph contains the given vertex element.
      static ComponentGroupMultiGraph createInstance​(org.apache.commons.collections15.Factory vertex_factory, org.apache.commons.collections15.Factory edge_factory, edu.uci.ics.jung.graph.Graph delegate)
      Factory method for the graph.
      int degree​(java.lang.Object vertex)
      Returns the degree (number of incident edges) of a vertex.
      IComponentGroup findEdge​(java.lang.Object ee)
      Returns the edge (group) for an edge element.
      java.lang.Object findEdge​(java.lang.Object v1, java.lang.Object v2)
      Returns the first edge between the two vertices.
      java.util.Collection findEdgeSet​(java.lang.Object v1, java.lang.Object v2)
      Returns a collection of edges between the two vertices.
      IComponentGroup findVertex​(java.lang.Object ve)
      Returns the vertex (group) for a vertex element.
      java.util.Collection getAllEdgeElements()
      Returns all edge elements.
      java.util.Collection getAllVertexElements()
      Returns all vertex elements.
      edu.uci.ics.jung.graph.util.EdgeType getDefaultEdgeType()  
      java.lang.Object getDest​(java.lang.Object directed_edge)
      Returns the destination of a directed edge.
      int getEdgeCount()  
      int getEdgeCount​(edu.uci.ics.jung.graph.util.EdgeType et)  
      java.util.Collection getEdges()
      Returns all edges of the graph.
      java.util.Collection getEdges​(edu.uci.ics.jung.graph.util.EdgeType edgeType)
      Returns the edges for a given edge type.
      edu.uci.ics.jung.graph.util.EdgeType getEdgeType​(java.lang.Object edge)
      Returns the edge type of en edge.
      edu.uci.ics.jung.graph.util.Pair getEndpoints​(java.lang.Object edge)
      Returns the endpoints of the edge.
      int getHighestEdgeWeight()
      Returns the highest edge weight
      int getHighestVertexWeight()
      Returns the highest vertex weight.
      int getIncidentCount​(java.lang.Object edge)
      Returns 2 if the edge has two different endpoints.
      java.util.Collection getIncidentEdges​(java.lang.Object vertex)
      Returns the incident edges of the vertex.
      java.util.Collection getIncidentVertices​(java.lang.Object edge)  
      java.util.Collection getInEdges​(java.lang.Object vertex)
      Returns the incoming edges of the vertex.
      int getNeighborCount​(java.lang.Object vertex)
      Returns the neighbor count.
      java.util.Collection getNeighbors​(java.lang.Object vertex)
      Returns the neighbor vertices of a given vertex.
      java.lang.Object getOpposite​(java.lang.Object vertex, java.lang.Object edge)
      Returns the other endpoint of the edge.
      java.util.Collection getOutEdges​(java.lang.Object vertex)
      Returns the outgoing edges of the vertex.
      int getPredecessorCount​(java.lang.Object vertex)
      Returns the number of vertices that have an outgoing edge to the given vertex.
      java.util.Collection getPredecessors​(java.lang.Object vertex)
      Returns the vertices that have an outgoing edge to the given vertex.
      java.lang.Object getSource​(java.lang.Object directed_edge)
      Returns the source of a directed edge.
      int getSuccessorCount​(java.lang.Object vertex)
      Returns the number of vertices that have an incoming edge from the given vertex.
      java.util.Collection getSuccessors​(java.lang.Object vertex)
      Returns the vertices that have an incoming edge from the given vertex.
      int getVertexCount()  
      java.util.Collection getVertices()
      Returns all vertices of the graph.
      int inDegree​(java.lang.Object vertex)
      Returns the count of incoming edges to the vertex.
      boolean isDest​(java.lang.Object vertex, java.lang.Object edge)
      Returns true if the vertex is the destination of the edge.
      boolean isIncident​(java.lang.Object vertex, java.lang.Object edge)
      Returns true if vertex and edge are incident to each other.
      boolean isNeighbor​(java.lang.Object v1, java.lang.Object v2)
      Returns true if v1 and v2 share an incident edge.
      boolean isPredecessor​(java.lang.Object v1, java.lang.Object v2)
      Returns true if there is an edge from first vertex to the second vertex.
      boolean isSource​(java.lang.Object vertex, java.lang.Object edge)
      Returns true if the vertex is the source of the edge.
      boolean isSuccessor​(java.lang.Object v1, java.lang.Object v2)
      Returns true if there is an edge from second vertex to the first vertex.
      int outDegree​(java.lang.Object vertex)
      Returns the count of outgoing edges from the vertex.
      boolean removeEdge​(java.lang.Object edge)
      Removes an edge.
      boolean removeEdgeElement​(java.lang.Object ee)
      Removes an edge element from the graph.
      boolean removeVertex​(java.lang.Object vertex)
      Removes a vertex.
      boolean removeVertexElement​(java.lang.Object ve)
      Removes a vertex element from the graph.
      java.lang.String toString()
      Text representation for this graph
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • vertex_factory

        protected org.apache.commons.collections15.Factory vertex_factory
        Factoriy for vertices
      • edge_factory

        protected org.apache.commons.collections15.Factory edge_factory
        Factories for edges
      • edge_elemets

        protected java.util.Map edge_elemets
        The map of edge elements
      • vertex_elemets

        protected java.util.Map vertex_elemets
        The map of vertex elements
      • delegate

        protected edu.uci.ics.jung.graph.Graph delegate
        The delegated graph
      • edge_weights

        protected jadex.tools.comanalyzer.graph.ComponentGroupMultiGraph.GenericSortedList edge_weights
        The edge weights is the number of edge elements contained in the edge. The list is sorted that the edge with the highest number of elements is at the end of the list. The highest edge weight is therefore identified by accessing the last element of the list.
      • vertex_weights

        protected jadex.tools.comanalyzer.graph.ComponentGroupMultiGraph.GenericSortedList vertex_weights
        The vertex weights is the number of edges going in or out the vertex. The list is sorted that the vertex with the highest number of incident edges is at the end of the list. The highest vertex weight is therefore identified by accessing the last element of the list
    • Constructor Detail

      • ComponentGroupMultiGraph

        protected ComponentGroupMultiGraph​(org.apache.commons.collections15.Factory vertex_factory,
                                           org.apache.commons.collections15.Factory edge_factory,
                                           edu.uci.ics.jung.graph.Graph delegate)
        The constructor. Besides the delegated graph, you must provide factories for the vertex and edges, since its not possible to instantiate type bound parameter (at least not that easy)
        Parameters:
        vertex_factory - The factory for vertices.
        edge_factory - The factory for edges.
        delegate - The delegated graph.
    • Method Detail

      • createInstance

        public static ComponentGroupMultiGraph createInstance​(org.apache.commons.collections15.Factory vertex_factory,
                                                              org.apache.commons.collections15.Factory edge_factory,
                                                              edu.uci.ics.jung.graph.Graph delegate)
        Factory method for the graph.
        Parameters:
        vertex_factory - The factory for vertices.
        edge_factory - The factory for edges.
        delegate - The delegated graph.
        Returns:
        The ComponentGroupMultiGraph.
      • clear

        public void clear()
        Clear all elements from the delegated graph and this graph.
      • addVertexElement

        public boolean addVertexElement​(java.lang.Object ve)
        Adds a new vertex containing the vertex element to the graph.
        Parameters:
        ve - The vertex element to add.
        Returns:
        true if success.
      • appendVertexElement

        public boolean appendVertexElement​(java.lang.Object ve,
                                           java.lang.Object v)
        Append a vertex element to a vertex.
        Parameters:
        ve - The vertex element to append.
        v - The vertex the element is append to.
        Returns:
        true if success.
      • addEdgeElement

        public boolean addEdgeElement​(java.lang.Object ee,
                                      java.lang.Object ve1,
                                      java.lang.Object ve2,
                                      edu.uci.ics.jung.graph.util.EdgeType edgeType)
        Adds an edge element with given vertex elements and edge type to the graph. If the two vertex elements are already part of vertices, a new edge between these vertices is added. If the vertex elements dont already exist in the graph, new vertices are created. A new edge is created in any case.
        Returns:
        true if success.
      • addEdgeElement

        public boolean addEdgeElement​(java.lang.Object ee,
                                      java.lang.Object ve1,
                                      java.lang.Object ve2)
        Adds an directed edge element with given vertex elements to the graph. If the two vertex elements are already part of vertices, a new edge between these vertices is added. If the vertex elements dont already exist in the graph, new vertices are created. A new edge is created in any case.
        Returns:
        true if success.
      • appendEdgeElement

        public boolean appendEdgeElement​(java.lang.Object ee,
                                         java.lang.Object ve1,
                                         java.lang.Object ve2)
        Appends an directed edge element with given vertex elements to the graph. If the two vertex elements are already part of vertices, and these vertices have a connection, the edge element is appended to this edge. Otherwise the components are added as new edge and new vertices to the graph.
        Returns:
        true if success.
      • appendEdgeElement

        public boolean appendEdgeElement​(java.lang.Object ee,
                                         java.lang.Object ve1,
                                         java.lang.Object ve2,
                                         edu.uci.ics.jung.graph.util.EdgeType edgeType)
        Appends an edge element with given vertex elements and edge type to the graph. If the two vertex elements are already part of vertices, and these vertices have a connection, the edge element is appended to this edge. Otherwise the components are added as a new edge and new vertices to the graph. The type of the edge can be directed or undirected
        Returns:
        true if success.
      • findEdge

        public IComponentGroup findEdge​(java.lang.Object ee)
        Returns the edge (group) for an edge element.
        Parameters:
        ee - The edge element to find.
        Returns:
        The edge for this element.
      • findVertex

        public IComponentGroup findVertex​(java.lang.Object ve)
        Returns the vertex (group) for a vertex element.
        Parameters:
        ve - The vertex element to find
        Returns:
        The vertex for this element.
      • containsEdgeElement

        public boolean containsEdgeElement​(java.lang.Object ee)
        Returns true if the graph contains the given edge element.
        Parameters:
        ee - The edge element to query
        Returns:
        true if present
      • containsVertexElement

        public boolean containsVertexElement​(java.lang.Object ve)
        Returns true if the graph contains the given vertex element.
        Parameters:
        ve - The vertex element to query
        Returns:
        true if success
      • removeEdgeElement

        public boolean removeEdgeElement​(java.lang.Object ee)
        Removes an edge element from the graph.
        Parameters:
        ee - The edge element to remove
        Returns:
        true if success.
      • removeVertexElement

        public boolean removeVertexElement​(java.lang.Object ve)
        Removes a vertex element from the graph.
        Parameters:
        ve - The vertex element to remove
        Returns:
        true if success
      • getAllEdgeElements

        public java.util.Collection getAllEdgeElements()
        Returns all edge elements.
        Returns:
        The collection of all edge elements.
      • getAllVertexElements

        public java.util.Collection getAllVertexElements()
        Returns all vertex elements.
        Returns:
        The collection of all vertex elements.
      • getHighestEdgeWeight

        public int getHighestEdgeWeight()
        Returns the highest edge weight
        Returns:
        The highest weight of all edges.
      • getHighestVertexWeight

        public int getHighestVertexWeight()
        Returns the highest vertex weight.
        Returns:
        The highest weight of all vertices.
      • addEdge

        public boolean addEdge​(java.lang.Object edge,
                               java.util.Collection vertices)
        Adds an edge to the graph.
        Specified by:
        addEdge in interface edu.uci.ics.jung.graph.Hypergraph
        Parameters:
        edge - The edge.
        vertices - A collection of veritexes. The size of the Collection must be 2.
        Returns:
        true if success.
      • addEdge

        public boolean addEdge​(java.lang.Object e,
                               java.lang.Object v1,
                               java.lang.Object v2,
                               edu.uci.ics.jung.graph.util.EdgeType edgeType)
        Adds an edge with a given edge type to the graph.
        Specified by:
        addEdge in interface edu.uci.ics.jung.graph.Graph
        Parameters:
        e - The edge.
        v1 - The first vertex.
        v2 - The second vertex.
        edgeType - The edge type.
        Returns:
        true if success.
      • addEdge

        public boolean addEdge​(java.lang.Object edge,
                               java.util.Collection vertices,
                               edu.uci.ics.jung.graph.util.EdgeType edge_type)
        Adds edge to this graph with type edge_type. Fails under the following circumstances: edge is already an element of the graph
      • edge or vertices is null
      • vertices has the wrong number of vertices for the graph type
      • vertices are already connected by another edge in this graph, and this graph does not accept parallel edges
      • edge_type is not legal for this graph
        Specified by:
        addEdge in interface edu.uci.ics.jung.graph.Hypergraph
        Parameters:
        edge -
        vertices -
        Returns:
        true if the add is successful, and false otherwise
        Throws:
        java.lang.IllegalArgumentException - if edge or vertices is null, or if a different vertex set in this graph is already connected by edge, or if vertices are not a legal vertex set for edge
      • addEdge

        public boolean addEdge​(java.lang.Object e,
                               java.lang.Object v1,
                               java.lang.Object v2)
        Adds an directed edge to the graph.
        Specified by:
        addEdge in interface edu.uci.ics.jung.graph.Graph
        Parameters:
        e - The edge.
        v1 - The first vertex.
        v2 - The second vertex.
        Returns:
        true if success.
      • addVertex

        public boolean addVertex​(java.lang.Object vertex)
        Adds a vertex to the graph.
        Specified by:
        addVertex in interface edu.uci.ics.jung.graph.Hypergraph
        Parameters:
        vertex - The vertex.
        Returns:
        true if success.
      • removeEdge

        public boolean removeEdge​(java.lang.Object edge)
        Removes an edge.
        Specified by:
        removeEdge in interface edu.uci.ics.jung.graph.Hypergraph
        Parameters:
        edge - The edge to remove.
        Returns:
        true if success.
      • removeVertex

        public boolean removeVertex​(java.lang.Object vertex)
        Removes a vertex.
        Specified by:
        removeVertex in interface edu.uci.ics.jung.graph.Hypergraph
        Parameters:
        vertex - The vertex.
        Returns:
        true if success.
      • isIncident

        public boolean isIncident​(java.lang.Object vertex,
                                  java.lang.Object edge)
        Returns true if vertex and edge are incident to each other. Equivalent to getIncidentEdges(vertex).contains(edge) and to getIncidentVertices(edge).contains(vertex).
        Specified by:
        isIncident in interface edu.uci.ics.jung.graph.Hypergraph
        Parameters:
        vertex -
        edge -
        Returns:
        true if vertex and edge are incident to each other
      • isNeighbor

        public boolean isNeighbor​(java.lang.Object v1,
                                  java.lang.Object v2)
        Returns true if v1 and v2 share an incident edge. Equivalent to getNeighbors(v1).contains(v2).
        Specified by:
        isNeighbor in interface edu.uci.ics.jung.graph.Hypergraph
        Parameters:
        v1 - the first vertex to test
        v2 - the second vertex to test
        Returns:
        true if v1 and v2 share an incident edge
      • containsEdge

        public boolean containsEdge​(java.lang.Object edge)
        Returns true if the graph contains the edge.
        Specified by:
        containsEdge in interface edu.uci.ics.jung.graph.Hypergraph
        Parameters:
        edge - The edge.
        Returns:
        true if the edge is in the graph.
      • containsVertex

        public boolean containsVertex​(java.lang.Object vertex)
        Returns true if the graph contains the vertex.
        Specified by:
        containsVertex in interface edu.uci.ics.jung.graph.Hypergraph
        Parameters:
        vertex - The vertex.
        Returns:
        true if the vertex is in the graph.
      • degree

        public int degree​(java.lang.Object vertex)
        Returns the degree (number of incident edges) of a vertex.
        Specified by:
        degree in interface edu.uci.ics.jung.graph.Hypergraph
        Parameters:
        vertex - The vertex.
        Returns:
        The degree.
      • findEdge

        public java.lang.Object findEdge​(java.lang.Object v1,
                                         java.lang.Object v2)
        Returns the first edge between the two vertices.
        Specified by:
        findEdge in interface edu.uci.ics.jung.graph.Hypergraph
        Parameters:
        v1 - The first vertex.
        v2 - The second vertex.
        Returns:
        The edge or null if there is no incident edge between the vertices.
      • findEdgeSet

        public java.util.Collection findEdgeSet​(java.lang.Object v1,
                                                java.lang.Object v2)
        Returns a collection of edges between the two vertices.
        Specified by:
        findEdgeSet in interface edu.uci.ics.jung.graph.Hypergraph
        Parameters:
        v1 - The first vertex.
        v2 - The second vertex.
        Returns:
        The collection of edges or null if there is no incident edge between the vertices.
      • getDest

        public java.lang.Object getDest​(java.lang.Object directed_edge)
        Returns the destination of a directed edge.
        Specified by:
        getDest in interface edu.uci.ics.jung.graph.Graph
        Specified by:
        getDest in interface edu.uci.ics.jung.graph.Hypergraph
        Parameters:
        directed_edge - The edge.
        Returns:
        The vertex.
      • getEdgeCount

        public int getEdgeCount()
        Specified by:
        getEdgeCount in interface edu.uci.ics.jung.graph.Hypergraph
        Returns:
        The edge count.
      • getEdgeCount

        public int getEdgeCount​(edu.uci.ics.jung.graph.util.EdgeType et)
        Specified by:
        getEdgeCount in interface edu.uci.ics.jung.graph.Hypergraph
        Returns:
        The edge count.
      • getEdges

        public java.util.Collection getEdges()
        Returns all edges of the graph.
        Specified by:
        getEdges in interface edu.uci.ics.jung.graph.Hypergraph
        Returns:
        The collection of edges.
      • getEdges

        public java.util.Collection getEdges​(edu.uci.ics.jung.graph.util.EdgeType edgeType)
        Returns the edges for a given edge type.
        Specified by:
        getEdges in interface edu.uci.ics.jung.graph.Hypergraph
        Parameters:
        edgeType - The edge tzpe.
        Returns:
        The collection of edges.
      • getEdgeType

        public edu.uci.ics.jung.graph.util.EdgeType getEdgeType​(java.lang.Object edge)
        Returns the edge type of en edge.
        Specified by:
        getEdgeType in interface edu.uci.ics.jung.graph.Hypergraph
        Parameters:
        edge - The edge.
        Returns:
        The edge type.
      • getEndpoints

        public edu.uci.ics.jung.graph.util.Pair getEndpoints​(java.lang.Object edge)
        Returns the endpoints of the edge.
        Specified by:
        getEndpoints in interface edu.uci.ics.jung.graph.Graph
        Parameters:
        edge - The edge.
        Returns:
        The endpoints.
      • getIncidentCount

        public int getIncidentCount​(java.lang.Object edge)
        Returns 2 if the edge has two different endpoints. If ist a loop the method returns 1.
        Specified by:
        getIncidentCount in interface edu.uci.ics.jung.graph.Hypergraph
        Parameters:
        edge - The edge.
        Returns:
        The incident count.
      • getIncidentEdges

        public java.util.Collection getIncidentEdges​(java.lang.Object vertex)
        Returns the incident edges of the vertex.
        Specified by:
        getIncidentEdges in interface edu.uci.ics.jung.graph.Hypergraph
        Parameters:
        vertex - The vertex.
        Returns:
        The collection of edges.
      • getIncidentVertices

        public java.util.Collection getIncidentVertices​(java.lang.Object edge)
        Specified by:
        getIncidentVertices in interface edu.uci.ics.jung.graph.Hypergraph
      • getInEdges

        public java.util.Collection getInEdges​(java.lang.Object vertex)
        Returns the incoming edges of the vertex.
        Specified by:
        getInEdges in interface edu.uci.ics.jung.graph.Graph
        Specified by:
        getInEdges in interface edu.uci.ics.jung.graph.Hypergraph
        Parameters:
        vertex - The vertx
        Returns:
        The collection of edges.
      • getNeighborCount

        public int getNeighborCount​(java.lang.Object vertex)
        Returns the neighbor count.
        Specified by:
        getNeighborCount in interface edu.uci.ics.jung.graph.Hypergraph
        Parameters:
        vertex - The vertex.
        Returns:
        The count of neighbors.
      • getNeighbors

        public java.util.Collection getNeighbors​(java.lang.Object vertex)
        Returns the neighbor vertices of a given vertex.
        Specified by:
        getNeighbors in interface edu.uci.ics.jung.graph.Hypergraph
        Parameters:
        vertex - The vertex.
        Returns:
        The collection of neighbors.
      • getOpposite

        public java.lang.Object getOpposite​(java.lang.Object vertex,
                                            java.lang.Object edge)
        Returns the other endpoint of the edge.
        Specified by:
        getOpposite in interface edu.uci.ics.jung.graph.Graph
        Parameters:
        vertex - The vertex.
        edge - The edge.
        Returns:
        The opposit.
      • getOutEdges

        public java.util.Collection getOutEdges​(java.lang.Object vertex)
        Returns the outgoing edges of the vertex.
        Specified by:
        getOutEdges in interface edu.uci.ics.jung.graph.Graph
        Specified by:
        getOutEdges in interface edu.uci.ics.jung.graph.Hypergraph
        Parameters:
        vertex - The vertx
        Returns:
        The collection of edges.
      • getPredecessorCount

        public int getPredecessorCount​(java.lang.Object vertex)
        Returns the number of vertices that have an outgoing edge to the given vertex.
        Specified by:
        getPredecessorCount in interface edu.uci.ics.jung.graph.Graph
        Parameters:
        vertex - The vertex.
        Returns:
        The predecessor count.
      • getPredecessors

        public java.util.Collection getPredecessors​(java.lang.Object vertex)
        Returns the vertices that have an outgoing edge to the given vertex.
        Specified by:
        getPredecessors in interface edu.uci.ics.jung.graph.Graph
        Specified by:
        getPredecessors in interface edu.uci.ics.jung.graph.Hypergraph
        Parameters:
        vertex - The vertex.
        Returns:
        The collection of vertices.
      • getSource

        public java.lang.Object getSource​(java.lang.Object directed_edge)
        Returns the source of a directed edge.
        Specified by:
        getSource in interface edu.uci.ics.jung.graph.Graph
        Specified by:
        getSource in interface edu.uci.ics.jung.graph.Hypergraph
        Parameters:
        directed_edge - The edge.
        Returns:
        The vertex.
      • getSuccessorCount

        public int getSuccessorCount​(java.lang.Object vertex)
        Returns the number of vertices that have an incoming edge from the given vertex.
        Specified by:
        getSuccessorCount in interface edu.uci.ics.jung.graph.Graph
        Parameters:
        vertex - The vertex.
        Returns:
        The successor count.
      • getSuccessors

        public java.util.Collection getSuccessors​(java.lang.Object vertex)
        Returns the vertices that have an incoming edge from the given vertex.
        Specified by:
        getSuccessors in interface edu.uci.ics.jung.graph.Graph
        Specified by:
        getSuccessors in interface edu.uci.ics.jung.graph.Hypergraph
        Parameters:
        vertex - The vertex.
        Returns:
        The collection of vertices.
      • getVertexCount

        public int getVertexCount()
        Specified by:
        getVertexCount in interface edu.uci.ics.jung.graph.Hypergraph
        Returns:
        The vertex count.
      • getVertices

        public java.util.Collection getVertices()
        Returns all vertices of the graph.
        Specified by:
        getVertices in interface edu.uci.ics.jung.graph.Hypergraph
        Returns:
        The collection of vertices.
      • inDegree

        public int inDegree​(java.lang.Object vertex)
        Returns the count of incoming edges to the vertex.
        Specified by:
        inDegree in interface edu.uci.ics.jung.graph.Graph
        Specified by:
        inDegree in interface edu.uci.ics.jung.graph.Hypergraph
        Parameters:
        vertex - The vertex.
        Returns:
        The incoming degree.
      • isDest

        public boolean isDest​(java.lang.Object vertex,
                              java.lang.Object edge)
        Returns true if the vertex is the destination of the edge.
        Specified by:
        isDest in interface edu.uci.ics.jung.graph.Graph
        Parameters:
        vertex - The vertex.
        edge - The edge.
        Returns:
        true if the vertex is the destination.
      • isPredecessor

        public boolean isPredecessor​(java.lang.Object v1,
                                     java.lang.Object v2)
        Returns true if there is an edge from first vertex to the second vertex.
        Specified by:
        isPredecessor in interface edu.uci.ics.jung.graph.Graph
        Parameters:
        v1 - The first vertex.
        v2 - The second vertex.
        Returns:
        true if the first vertex is predecessor of the second vertex.
      • isSource

        public boolean isSource​(java.lang.Object vertex,
                                java.lang.Object edge)
        Returns true if the vertex is the source of the edge.
        Specified by:
        isSource in interface edu.uci.ics.jung.graph.Graph
        Parameters:
        vertex - The vertex.
        edge - The edge.
        Returns:
        true if the vertex is the source.
      • isSuccessor

        public boolean isSuccessor​(java.lang.Object v1,
                                   java.lang.Object v2)
        Returns true if there is an edge from second vertex to the first vertex.
        Specified by:
        isSuccessor in interface edu.uci.ics.jung.graph.Graph
        Parameters:
        v1 - The first vertex.
        v2 - The second vertex.
        Returns:
        true if the second vertex is successor of the fist vertex.
      • outDegree

        public int outDegree​(java.lang.Object vertex)
        Returns the count of outgoing edges from the vertex.
        Specified by:
        outDegree in interface edu.uci.ics.jung.graph.Graph
        Specified by:
        outDegree in interface edu.uci.ics.jung.graph.Hypergraph
        Parameters:
        vertex - The vertex.
        Returns:
        The outgoing degree.
      • toString

        public java.lang.String toString()
        Text representation for this graph
        Overrides:
        toString in class java.lang.Object
        See Also:
        Object.toString()
      • getDefaultEdgeType

        public edu.uci.ics.jung.graph.util.EdgeType getDefaultEdgeType()
        Specified by:
        getDefaultEdgeType in interface edu.uci.ics.jung.graph.Hypergraph