drasys.or.graph
Class Graph

java.lang.Object
  |
  +--drasys.or.graph.Graph
Direct Known Subclasses:
BaseGraph, MatrixGraph

public abstract class Graph
extends java.lang.Object
implements GraphI, java.io.Serializable

An abstract class that contains convenience methods for derived classes.

See Also:
PointGraph, DenseGraph, SparseGraph, Serialized Form

Field Summary
protected  java.lang.Boolean _symmetric
           
 
Method Summary
 java.util.Enumeration edges()
          Creates an enumeration on the edges of the graph.
 boolean equals(java.lang.Object o)
          Two graphs are equal if they have exacty the same elements.
 EdgeI getEdge(EdgeI edge)
          Get the edge that matches edge.
 EdgeI getEdge(java.lang.Object fromKey, java.lang.Object toKey, java.lang.Object key)
          Get the edge between the from and to vertices whose key matches 'edgeKey'.
 boolean isSubsetOf(GraphI graph)
          A graph is a subset of another if all its elements are contained in the other.
 java.util.Enumeration mutableEdges()
          Creates an enumeration on the edges of the graph.
 void setSymmetric(java.lang.Boolean symmetric)
          Forces algorithms to treat the graph as either symmetric or assymetric.
 java.lang.String toString(java.lang.String cls)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_symmetric

protected java.lang.Boolean _symmetric
Method Detail

setSymmetric

public void setSymmetric(java.lang.Boolean symmetric)
Forces algorithms to treat the graph as either symmetric or assymetric. An argument of 'null' causes the graph to automatically determine the return value for 'isSymmetric()'.
Specified by:
setSymmetric in interface GraphI

getEdge

public EdgeI getEdge(EdgeI edge)
Get the edge that matches edge.
Specified by:
getEdge in interface GraphI
Returns:
Null if the edge is not in the graph.

getEdge

public EdgeI getEdge(java.lang.Object fromKey,
                     java.lang.Object toKey,
                     java.lang.Object key)
Get the edge between the from and to vertices whose key matches 'edgeKey'.
Specified by:
getEdge in interface GraphI
Returns:
Null if the edge is not in the graph.

edges

public java.util.Enumeration edges()
Creates an enumeration on the edges of the graph.
Specified by:
edges in interface GraphI
Returns:
An enumeration with elements of class EdgeI.

mutableEdges

public java.util.Enumeration mutableEdges()
Creates an enumeration on the edges of the graph. The enumeration is allowed to return mutable edges if that is more efficient, but the contents of an edge must be used before 'nextElement()' is called again.
Specified by:
mutableEdges in interface GraphI
Returns:
An enumeration with elements of class EdgeI.

toString

public java.lang.String toString(java.lang.String cls)

isSubsetOf

public boolean isSubsetOf(GraphI graph)
A graph is a subset of another if all its elements are contained in the other.
Specified by:
isSubsetOf in interface GraphI
Returns:
True if this graph is a subset of the argument.

equals

public boolean equals(java.lang.Object o)
Two graphs are equal if they have exacty the same elements.
Overrides:
equals in class java.lang.Object
Returns:
True if the graphs are equal.


Copyright(C)1997-2000 by DRA Systems all rights reserved. OpsResearch.com