Class Edge

Edge

public class Edge
implements java.lang.Comparable

Class: Edge //Author: M. E. D. //Date: April 27 1999 //Version: 1.0 import java.util.*; import java.awt.*; import java.awt.geom.*; import java.awt.geom.Line2D; import java.awt.geom.Point2D; import java.lang.*; /** this stores an edge which is simply two end points


Constructor Summary
Edge(intPoint ip1, intPoint ip2, int s, int e)
           
 
Method Summary
 int compareTo(java.lang.Object o)
          mehtod: compareTo description: used to allow the edges to be sorted in order by weight
 void display(Graphics g)
          method: dispaly description: Display the vertex on the screen
 Rectangle2D getBounds2D()
           
 int getEndPoint()
           
 Vertex getEndVertex()
           
 Point2D getP1()
           
 Point2D getP2()
           
 int getStartPoint()
           
 Vertex getStartVertex()
           
 double getX1()
           
 double getX2()
           
 double getY1()
           
 double getY2()
           
 void print()
           
 void setLine(double x, double y, double z, double a)
           
 void setWeight(double w)
           
 boolean shareVertex(Edge e)
          method: shareVertex description: returns true if this edge shares a vertex with another edge
 

Constructor Detail

Edge

public Edge(intPoint ip1,
            intPoint ip2,
            int s,
            int e)
Method Detail

getX1

public double getX1()

getY2

public double getY2()

getStartPoint

public int getStartPoint()

getEndPoint

public int getEndPoint()

setLine

public void setLine(double x,
                    double y,
                    double z,
                    double a)

getBounds2D

public Rectangle2D getBounds2D()

shareVertex

public boolean shareVertex(Edge e)
method: shareVertex description: returns true if this edge shares a vertex with another edge

getStartVertex

public Vertex getStartVertex()

getEndVertex

public Vertex getEndVertex()

getP2

public Point2D getP2()

getY1

public double getY1()

getX2

public double getX2()

getP1

public Point2D getP1()

setWeight

public void setWeight(double w)

print

public void print()

display

public void display(Graphics g)
method: dispaly description: Display the vertex on the screen

compareTo

public int compareTo(java.lang.Object o)
mehtod: compareTo description: used to allow the edges to be sorted in order by weight
Specified by:
compareTo in interface java.lang.Comparable