Added a Graph datastructure and refactored the Line/Vertex classes

This commit is contained in:
Quinn
2023-05-02 09:49:38 -05:00
parent 9b0acbe34c
commit 3321e77061
18 changed files with 859 additions and 68 deletions

45
src/Graph/Vertex.java Normal file
View File

@@ -0,0 +1,45 @@
package Graph;
public class Vertex {
private String vertexLabel;
private boolean isVisitedStatus = false;
/**
* Create a new vertex with a default label
*/
public Vertex(){
this.vertexLabel = "Unassigned";
}
/**
* @param label create a new vertex with this label
*/
public Vertex(String label){
this.vertexLabel = label;
}
/**
* @return the label of the vertex
*/
public String getLabel(){
return vertexLabel;
}
public void setLabel(String newLabel){
vertexLabel = newLabel;
}
/**
* @return if the node has been visited or not
*/
public boolean visitedStatus(){
return this.isVisitedStatus;
}
/**
* @param status set the visited status to true or false
*/
public void setVisitedStatus(boolean status){
this.isVisitedStatus = status;
}
}