Java 2 Platform
v1.3

edu.umich.visualsoar.graph
Class Edge

java.lang.Object
  |
  +--edu.umich.visualsoar.graph.Edge
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
NamedEdge

public class Edge
extends java.lang.Object
implements java.io.Serializable

This class represents an edge in a graph it is based on Object-Oriented Design patterns in C++, later converted to Java

See Also:
Serialized Form

Field Summary
protected  edu.umich.visualsoar.graph.Vertex v0
          v0 is the starting edge v1 is the ending edge
protected  edu.umich.visualsoar.graph.Vertex v1
           
 
Constructor Summary
private Edge()
           
  Edge(edu.umich.visualsoar.graph.Vertex _v0, edu.umich.visualsoar.graph.Vertex _v1)
          constructs and edge between the first vertex and the second one
 
Method Summary
 edu.umich.visualsoar.graph.Vertex mate(edu.umich.visualsoar.graph.Vertex v)
          if v equals the starting edge then return the ending edge if v equal the ending edge then return the starting edge else throw and exception
 java.lang.String toString()
          Produces string representation of the edge
 edu.umich.visualsoar.graph.Vertex V0()
           
 edu.umich.visualsoar.graph.Vertex V1()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

v0

protected edu.umich.visualsoar.graph.Vertex v0
v0 is the starting edge v1 is the ending edge


v1

protected edu.umich.visualsoar.graph.Vertex v1
Constructor Detail

Edge

private Edge()

Edge

public Edge(edu.umich.visualsoar.graph.Vertex _v0,
            edu.umich.visualsoar.graph.Vertex _v1)
constructs and edge between the first vertex and the second one

Method Detail

V0

public edu.umich.visualsoar.graph.Vertex V0()
Returns:
the starting edge

V1

public edu.umich.visualsoar.graph.Vertex V1()
Returns:
the ending edge

mate

public edu.umich.visualsoar.graph.Vertex mate(edu.umich.visualsoar.graph.Vertex v)
if v equals the starting edge then return the ending edge if v equal the ending edge then return the starting edge else throw and exception

Returns:
the starting edge
Throws:
java.lang.IllegalArgumentException

toString

public java.lang.String toString()
Produces string representation of the edge

Overrides:
toString in class java.lang.Object
Returns:
the representation

Java 2 Platform
v1.3