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
Edge
public Edge(intPoint ip1,
intPoint ip2,
int s,
int e)
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