public class Edge
extends java.lang.Object
Constructor and Description |
---|
Edge(int startX,
int startY,
int endX,
int endY)
Constuct an impassable Edge.
|
Edge(int startX,
int startY,
int endX,
int endY,
EntityID neighbour)
Constuct an Edge.
|
Edge(Point2D start,
Point2D end)
Constuct an impassable Edge.
|
Edge(Point2D start,
Point2D end,
EntityID neighbour)
Constuct an Edge.
|
Modifier and Type | Method and Description |
---|---|
Point2D |
getEnd()
Get the end point.
|
int |
getEndX()
Get the X coordinate of the second endpoint.
|
int |
getEndY()
Get the Y coordinate of the second endpoint.
|
Line2D |
getLine()
Get a line representing this edge.
|
EntityID |
getNeighbour()
Get the ID of the neighbour.
|
Point2D |
getStart()
Get the start point.
|
int |
getStartX()
Get the X coordinate of the first endpoint.
|
int |
getStartY()
Get the Y coordinate of the first endpoint.
|
boolean |
isPassable()
Find out if this edge is passable or not.
|
java.lang.String |
toString() |
public Edge(int startX, int startY, int endX, int endY)
startX
- The X coordinate of the first endpoint.startY
- The Y coordinate of the first endpoint.endX
- The X coordinate of the second endpoint.endY
- The Y coordinate of the second endpoint.public Edge(Point2D start, Point2D end)
start
- The first endpoint coordinates.end
- The second endpoint coordinates.public Edge(int startX, int startY, int endX, int endY, EntityID neighbour)
startX
- The X coordinate of the first endpoint.startY
- The Y coordinate of the first endpoint.endX
- The X coordinate of the second endpoint.endY
- The Y coordinate of the second endpoint.neighbour
- The ID of the neighbour on the other side of this edge. This may be null to indicate an impassable edge.public Edge(Point2D start, Point2D end, EntityID neighbour)
start
- The first endpoint coordinates.end
- The second endpoint coordinates.neighbour
- The ID of the neighbour on the other side of this edge. This may be null to indicate an impassable edge.public int getStartX()
public int getStartY()
public int getEndX()
public int getEndY()
public Point2D getStart()
public Point2D getEnd()
public EntityID getNeighbour()
public boolean isPassable()
public Line2D getLine()
public java.lang.String toString()
toString
in class java.lang.Object