Opus5
Class DigraphAsMatrix

java.lang.Object
  |
  +--Opus5.AbstractObject
        |
        +--Opus5.AbstractContainer
              |
              +--Opus5.AbstractGraph
                    |
                    +--Opus5.GraphAsMatrix
                          |
                          +--Opus5.DigraphAsMatrix
All Implemented Interfaces:
Comparable, Container, Digraph, Graph

public class DigraphAsMatrix
extends GraphAsMatrix
implements Digraph

A directed graph implemented using an adjacency matrix.

Version:
$Id: DigraphAsMatrix.java,v 3.2 1998/07/28 01:50:22 brpreiss Exp $
Author:
Bruno R. Preiss, P.Eng.

Inner classes inherited from class Opus5.AbstractGraph
AbstractGraph.Counter, AbstractGraph.GraphEdge, AbstractGraph.GraphVertex
 
Fields inherited from class Opus5.GraphAsMatrix
matrix
 
Fields inherited from class Opus5.AbstractGraph
numberOfEdges, numberOfVertices, vertex
 
Fields inherited from class Opus5.AbstractContainer
count
 
Fields inherited from interface Opus5.Digraph
copyright
 
Constructor Summary
DigraphAsMatrix(int size)
          Constructs a DigraphAsMatrix with the specified size.
 
Method Summary
protected  void addEdge(Edge edge)
          Adds the specified edge to this directed graph.
 Enumeration getEdges()
          Returns an enumeration that enumerates the edges in this graph.
 
Methods inherited from class Opus5.GraphAsMatrix
compareTo, getEdge, getEmanatingEdges, getIncidentEdges, isEdge, purge
 
Methods inherited from class Opus5.AbstractGraph
accept, addEdge, addEdge, addVertex, addVertex, addVertex, breadthFirstTraversal, depthFirstTraversal, getEnumeration, getNumberOfEdges, getNumberOfVertices, getVertex, getVertices, isConnected, isCyclic, isDirected, isStronglyConnected, topologicalOrderTraversal, toString
 
Methods inherited from class Opus5.AbstractContainer
getCount, hashCode, isEmpty, isFull
 
Methods inherited from class Opus5.AbstractObject
compare, equals, isEQ, isGE, isGT, isLE, isLT, isNE
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface Opus5.Digraph
isStronglyConnected, topologicalOrderTraversal
 
Methods inherited from interface Opus5.Graph
addEdge, addEdge, addVertex, addVertex, breadthFirstTraversal, depthFirstTraversal, getEdge, getNumberOfEdges, getNumberOfVertices, getVertex, getVertices, isConnected, isCyclic, isDirected, isEdge
 
Methods inherited from interface Opus5.Container
accept, getCount, getEnumeration, isEmpty, isFull, purge
 
Methods inherited from interface Opus5.Comparable
compare, isEQ, isGE, isGT, isLE, isLT, isNE
 

Constructor Detail

DigraphAsMatrix

public DigraphAsMatrix(int size)
Constructs a DigraphAsMatrix with the specified size.
Parameters:
size - The maximum number of vertices.
Method Detail

addEdge

protected void addEdge(Edge edge)
Adds the specified edge to this directed graph.
Overrides:
addEdge in class GraphAsMatrix
Parameters:
edge - The edge to add.
Throws:
java.lang.IllegalArgumentException - If there already is an edge in this graph that connects the same vertices.

getEdges

public Enumeration getEdges()
Returns an enumeration that enumerates the edges in this graph.
Specified by:
getEdges in interface Graph
Overrides:
getEdges in class GraphAsMatrix
Returns:
An enumeration that enumerates the edges in this graph.