annas.graph
Class UndirectedGraph<N,A extends ArcInterface<N>>

java.lang.Object
  extended by annas.graph.Graph<N,A>
      extended by annas.graph.UndirectedGraph<N,A>
Type Parameters:
N - Node type
A - Arc type
All Implemented Interfaces:
GraphInterface<N,A>

public class UndirectedGraph<N,A extends ArcInterface<N>>
extends Graph<N,A>
implements GraphInterface<N,A>

Implementation of a Undirected Graph similar to @see Directed Graph

Author:
Sam Wilson

Constructor Summary
UndirectedGraph()
           
UndirectedGraph(GraphObserver observer)
           
 
Method Summary
 boolean addArc(N tail, N head, WeightedInterface wi)
          Adds an arc to the graph, adds to directed arcs to the graph.
 
Methods inherited from class annas.graph.Graph
addNode, contains, getArc, getArc, getArcFactory, getNodeMap, getNuArcs, getNuNodes, getObserver, getVersion, removeArc, removeArc, removeArc, removeNode, resetArcs, setObserver
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface annas.graph.GraphInterface
addNode, contains, getArc, getArc, getArcFactory, getNodeMap, getNuArcs, getNuNodes, getObserver, getVersion, removeArc, removeArc, removeArc, removeNode, resetArcs
 

Constructor Detail

UndirectedGraph

public UndirectedGraph()

UndirectedGraph

public UndirectedGraph(GraphObserver observer)
Method Detail

addArc

public boolean addArc(N tail,
                      N head,
                      WeightedInterface wi)
Adds an arc to the graph, adds to directed arcs to the graph. This graph increments the graph version by two.

Specified by:
addArc in interface GraphInterface<N,A extends ArcInterface<N>>
Overrides:
addArc in class Graph<N,A extends ArcInterface<N>>
Parameters:
tail - Tail of the arc
head - Head of the arc
wi - WeightedInterface
Returns:
true if the arc was successfully added