Fix List to ArrayList

Add toString method for Box
Add code to print the shortest path for this particular case.
This commit is contained in:
antograb committed 2017-12-10 17:08:54 +01:00
1 parent fda73a2025
commit d46b3c3b99
8 files changed
+19 -21

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
package maze;
public class ABox extends Box{
public class ABox extends EBox{
public ABox (String label, int x, int y, Maze maze) {
+4 -4
View File
@@ -21,7 +21,7 @@ public abstract class Box
}
public List<VertexInterface> generateNeighbors() {
public ArrayList<VertexInterface> generateNeighbors() {
return maze.generateNeighbours(this) ;
}
@@ -45,11 +45,11 @@ public abstract class Box
return false ;
}
public List<Box> getNeighbourList() {
public ArrayList<Box> getNeighbourList() {
return neighbourList;
}
public void setNeighbourList(List<Box> neighbourList) {
public void setNeighbourList(ArrayList<Box> neighbourList) {
this.neighbourList = neighbourList;
}
@@ -86,7 +86,7 @@ public abstract class Box
}
public String toString() {
return label;
return "Label: " + label + ", x: " + x + ", y: " + y;
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
package maze;
public class DBox extends Box{
public class DBox extends EBox{
public DBox (String label, int x, int y, Maze maze) {
+1 -2
View File
@@ -3,12 +3,11 @@ package maze;
public class MazeReadingException
extends Exception {
private String filename ;
private static final long serialVersionUID = 1L;
public MazeReadingException (String filename) {
super("Invalid maze format : " + filename) ;
this.filename = filename ;
}