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

java.lang.Object
  extended byorg.apache.commons.graph.domain.basic.DirectedGraphImpl
All Implemented Interfaces:
DirectedGraph, Graph, java.lang.reflect.InvocationHandler, MutableDirectedGraph, WeightedGraph
Direct Known Subclasses:
JDependGraph

public class DirectedGraphImpl
extends java.lang.Object
implements DirectedGraph, WeightedGraph, MutableDirectedGraph, java.lang.reflect.InvocationHandler

Description of the Class


Field Summary
private  java.util.List contracts
           
private  java.util.Set edges
           
private  java.util.Map edgeSource
           
private  java.util.Map edgeTarget
           
private  java.util.Map edgeWeights
           
private  java.util.Map inbound
           
private  java.util.Map outbound
           
private  Vertex root
           
private  java.util.Set vertices
           
 
Constructor Summary
DirectedGraphImpl()
          Constructor for the DirectedGraphImpl object
DirectedGraphImpl(DirectedGraph dg)
          Constructor for the DirectedGraphImpl object
 
Method Summary
 void addContract(Contract c)
          Adds a feature to the Contract attribute of the DirectedGraphImpl object
 void addEdge(Edge e, Vertex start, Vertex end)
          Adds a feature to the Edge attribute of the DirectedGraphImpl object
private  void addEdgeI(Edge e, Vertex start, Vertex end)
          Adds a feature to the EdgeI attribute of the DirectedGraphImpl object
 void addVertex(Vertex v)
          Adds a feature to the Vertex attribute of the DirectedGraphImpl object
private  void addVertexI(Vertex v)
          Adds a feature to the VertexI attribute of the DirectedGraphImpl object
 java.util.Set getEdges()
          Gets the edges attribute of the DirectedGraphImpl object
 java.util.Set getEdges(Vertex v)
          Gets the edges attribute of the DirectedGraphImpl object
 java.util.Set getInbound(Vertex v)
          Gets the inbound attribute of the DirectedGraphImpl object
 java.util.Set getOutbound(Vertex v)
          Gets the outbound attribute of the DirectedGraphImpl object
 Vertex getSource(Edge e)
          Gets the source attribute of the DirectedGraphImpl object
 Vertex getTarget(Edge e)
          Gets the target attribute of the DirectedGraphImpl object
 java.util.Set getVertices()
          Gets the vertices attribute of the DirectedGraphImpl object
 java.util.Set getVertices(Edge e)
          Gets the vertices attribute of the DirectedGraphImpl object
 double getWeight(Edge e)
          Gets the weight attribute of the DirectedGraphImpl object
 java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
          Description of the Method
 void removeContract(Contract c)
          Description of the Method
 void removeEdge(Edge e)
          Description of the Method
private  void removeEdgeI(Edge e)
          Description of the Method
 void removeVertex(Vertex v)
          Description of the Method
private  void removeVertexI(Vertex v)
          Description of the Method
 void setWeight(Edge e, double value)
          Sets the weight attribute of the DirectedGraphImpl object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

root

private Vertex root

vertices

private java.util.Set vertices

edges

private java.util.Set edges

contracts

private java.util.List contracts

inbound

private java.util.Map inbound

outbound

private java.util.Map outbound

edgeSource

private java.util.Map edgeSource

edgeTarget

private java.util.Map edgeTarget

edgeWeights

private java.util.Map edgeWeights
Constructor Detail

DirectedGraphImpl

public DirectedGraphImpl()
Constructor for the DirectedGraphImpl object


DirectedGraphImpl

public DirectedGraphImpl(DirectedGraph dg)
Constructor for the DirectedGraphImpl object

Parameters:
dg -
Method Detail

addContract

public void addContract(Contract c)
                 throws GraphException
Adds a feature to the Contract attribute of the DirectedGraphImpl object

Throws:
GraphException

removeContract

public void removeContract(Contract c)
Description of the Method


setWeight

public void setWeight(Edge e,
                      double value)
Sets the weight attribute of the DirectedGraphImpl object


getVertices

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

Specified by:
getVertices in interface Graph

getVertices

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

Specified by:
getVertices in interface Graph

getEdges

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

Specified by:
getEdges in interface Graph

getEdges

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

Specified by:
getEdges in interface Graph

getSource

public Vertex getSource(Edge e)
Gets the source attribute of the DirectedGraphImpl object

Specified by:
getSource in interface DirectedGraph

getTarget

public Vertex getTarget(Edge e)
Gets the target attribute of the DirectedGraphImpl object

Specified by:
getTarget in interface DirectedGraph

getInbound

public java.util.Set getInbound(Vertex v)
Gets the inbound attribute of the DirectedGraphImpl object

Specified by:
getInbound in interface DirectedGraph

getOutbound

public java.util.Set getOutbound(Vertex v)
Gets the outbound attribute of the DirectedGraphImpl object

Specified by:
getOutbound in interface DirectedGraph

addVertexI

private void addVertexI(Vertex v)
                 throws GraphException
Adds a feature to the VertexI attribute of the DirectedGraphImpl object

Throws:
GraphException

addVertex

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

Specified by:
addVertex in interface MutableDirectedGraph
Throws:
GraphException

removeVertexI

private void removeVertexI(Vertex v)
                    throws GraphException
Description of the Method

Throws:
GraphException

removeVertex

public void removeVertex(Vertex v)
                  throws GraphException
Description of the Method

Specified by:
removeVertex in interface MutableDirectedGraph
Throws:
GraphException

addEdgeI

private void addEdgeI(Edge e,
                      Vertex start,
                      Vertex end)
               throws GraphException
Adds a feature to the EdgeI attribute of the DirectedGraphImpl object

Throws:
GraphException

addEdge

public void addEdge(Edge e,
                    Vertex start,
                    Vertex end)
             throws GraphException
Adds a feature to the Edge attribute of the DirectedGraphImpl object

Specified by:
addEdge in interface MutableDirectedGraph
Throws:
GraphException

removeEdgeI

private void removeEdgeI(Edge e)
                  throws GraphException
Description of the Method

Throws:
GraphException

removeEdge

public void removeEdge(Edge e)
                throws GraphException
Description of the Method

Specified by:
removeEdge in interface MutableDirectedGraph
Throws:
GraphException

getWeight

public double getWeight(Edge e)
Gets the weight attribute of the DirectedGraphImpl 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