org.apache.commons.graph.domain.basic
Class UndirectedGraphImpl

java.lang.Object
  extended byorg.apache.commons.graph.domain.basic.UndirectedGraphImpl
All Implemented Interfaces:
Graph, java.lang.reflect.InvocationHandler, MutableGraph, UndirectedGraph, WeightedGraph
Direct Known Subclasses:
MinimumSpanningForest

public class UndirectedGraphImpl
extends java.lang.Object
implements UndirectedGraph, WeightedGraph, MutableGraph, java.lang.reflect.InvocationHandler

Description of the Class


Field Summary
private  java.util.Set edges
           
private  java.util.Map edgeVerts
           
private  java.util.Map edgeWeights
           
private  java.util.Map vertEdges
           
private  java.util.Set vertices
           
 
Constructor Summary
UndirectedGraphImpl()
          Constructor for the UndirectedGraphImpl object
 
Method Summary
 void addEdge(Edge e)
          Adds a feature to the Edge attribute of the MutableGraph object
 void addEdge(Edge e, java.util.Set vertices)
          Adds a feature to the Edge attribute of the UndirectedGraphImpl object
 void addVertex(Vertex v)
          Adds a feature to the Vertex attribute of the UndirectedGraphImpl object
 void connect(Edge e, Vertex v)
          Description of the Method
 void disconnect(Edge e, Vertex v)
          Description of the Method
 java.util.Set getEdges()
          Gets the edges attribute of the UndirectedGraphImpl object
 java.util.Set getEdges(Vertex v)
          Gets the edges attribute of the UndirectedGraphImpl object
 java.util.Set getVertices()
          Gets the vertices attribute of the UndirectedGraphImpl object
 java.util.Set getVertices(Edge e)
          Gets the vertices attribute of the UndirectedGraphImpl object
 double getWeight(Edge e)
          Gets the weight attribute of the WeightedGraph object
 java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
          Description of the Method
 void removeEdge(Edge e)
          Description of the Method
 void removeVertex(Vertex v)
          Description of the Method
 void setWeight(Edge e, double w)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

vertices

private java.util.Set vertices

edges

private java.util.Set edges

edgeVerts

private java.util.Map edgeVerts

vertEdges

private java.util.Map vertEdges

edgeWeights

private java.util.Map edgeWeights
Constructor Detail

UndirectedGraphImpl

public UndirectedGraphImpl()
Constructor for the UndirectedGraphImpl object

Method Detail

addVertex

public void addVertex(Vertex v)
               throws GraphException
Adds a feature to the Vertex attribute of the UndirectedGraphImpl object

Specified by:
addVertex in interface MutableGraph
Throws:
GraphException

removeVertex

public void removeVertex(Vertex v)
                  throws GraphException
Description copied from interface: MutableGraph
Description of the Method

Specified by:
removeVertex in interface MutableGraph
Throws:
GraphException

removeEdge

public void removeEdge(Edge e)
                throws GraphException
Description copied from interface: MutableGraph
Description of the Method

Specified by:
removeEdge in interface MutableGraph
Throws:
GraphException

addEdge

public void addEdge(Edge e)
             throws GraphException
Description copied from interface: MutableGraph
Adds a feature to the Edge attribute of the MutableGraph object

Specified by:
addEdge in interface MutableGraph
Throws:
GraphException

disconnect

public void disconnect(Edge e,
                       Vertex v)
Description copied from interface: MutableGraph
Description of the Method

Specified by:
disconnect in interface MutableGraph

connect

public void connect(Edge e,
                    Vertex v)
Description copied from interface: MutableGraph
Description of the Method

Specified by:
connect in interface MutableGraph

addEdge

public void addEdge(Edge e,
                    java.util.Set vertices)
             throws GraphException
Adds a feature to the Edge attribute of the UndirectedGraphImpl object

Throws:
GraphException

getVertices

public java.util.Set getVertices()
Gets the vertices attribute of the UndirectedGraphImpl object

Specified by:
getVertices in interface Graph

getVertices

public java.util.Set getVertices(Edge e)
Gets the vertices attribute of the UndirectedGraphImpl object

Specified by:
getVertices in interface Graph

getEdges

public java.util.Set getEdges()
Gets the edges attribute of the UndirectedGraphImpl object

Specified by:
getEdges in interface Graph

getEdges

public java.util.Set getEdges(Vertex v)
Gets the edges attribute of the UndirectedGraphImpl object

Specified by:
getEdges in interface Graph

setWeight

public void setWeight(Edge e,
                      double w)

getWeight

public double getWeight(Edge e)
Description copied from interface: WeightedGraph
Gets the weight attribute of the WeightedGraph object

Specified by:
getWeight in interface WeightedGraph

invoke

public java.lang.Object invoke(java.lang.Object proxy,
                               java.lang.reflect.Method method,
                               java.lang.Object[] args)
                        throws java.lang.Throwable
Description of the Method

Specified by:
invoke in interface java.lang.reflect.InvocationHandler
Throws:
java.lang.Throwable