ProjektGraph/graph/Vertex.java

69 lines
1.2 KiB
Java
Raw Normal View History

2024-06-15 14:48:28 +00:00
package graph;
2024-07-01 18:10:25 +00:00
import java.awt.Color;
2024-07-02 15:51:22 +00:00
public abstract class Vertex{
2024-06-15 14:48:28 +00:00
// ATTRIBUTE
2024-06-15 14:48:28 +00:00
private String name;
2024-07-01 18:10:25 +00:00
private Color color;
private int distance;
2024-07-01 15:08:11 +00:00
private int xCoordinate;
private int yCoordinate;
2024-06-15 14:48:28 +00:00
2024-07-01 18:10:25 +00:00
// KONSTRUKTOREN
2024-06-15 14:48:28 +00:00
public Vertex() {
2024-07-02 15:51:22 +00:00
2024-06-15 14:48:28 +00:00
}
2024-07-01 18:10:25 +00:00
public Vertex(int xCoordinate, int yCoordinate, String name, Color color) {
2024-07-02 15:51:22 +00:00
this.xCoordinate = xCoordinate;
this.yCoordinate = yCoordinate;
this.name = name;
this.color = color;
2024-06-15 14:48:28 +00:00
}
// GET-ER
2024-06-15 14:48:28 +00:00
public String getName() {
return this.name;
}
2024-07-01 18:10:25 +00:00
public Color getColor() {
return this.color;
}
public int getDistance() {
return this.distance;
}
2024-07-01 15:08:11 +00:00
public int getXCoordinate(){
return this.xCoordinate;
}
public int getYCoordinate(){
return this.yCoordinate;
}
2024-06-25 15:18:34 +00:00
// SET-ER
2024-06-15 14:48:28 +00:00
public void setName(String s) {
this.name = s;
}
2024-07-01 18:10:25 +00:00
public void setColor(Color s) {
this.color = s;
}
public void setDistance(int s) {
this.distance = s;
}
2024-07-01 15:08:11 +00:00
public void setXCoordinate(int xCoordinate){
this.xCoordinate=xCoordinate;
}
public void setYCoordinate(int yCoordinate){
this.yCoordinate=yCoordinate;
}
2024-06-25 15:18:34 +00:00
2024-06-15 14:48:28 +00:00
}