From 8a8eac7ac11883f154398d5a097af1151ef007d5 Mon Sep 17 00:00:00 2001 From: Antonin Godard Date: Thu, 7 Dec 2017 14:29:04 +0100 Subject: [PATCH] Added some documentation for classes and methods of modified files. --- src/maze/Box.java | 12 ++++++++++++ src/maze/Maze.java | 12 ++++++++++-- src/maze/MazeReadingException.java | 7 +++++++ 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/maze/Box.java b/src/maze/Box.java index 2326e21..9219de9 100644 --- a/src/maze/Box.java +++ b/src/maze/Box.java @@ -4,6 +4,18 @@ import java.util.List; import dijkstra.VertexInterface; +/**

Box class

+ *

+ * + * This class describes a Box and implements {@link dijkstra.VertexInterface}. + *

+ * A Box is represented with its coordinates, its label, and its neighbourList. It also has a reference on the Maze. + * + * @author Antonin Godard + * @author Sylvain Rager + * + */ + public abstract class Box implements VertexInterface { diff --git a/src/maze/Maze.java b/src/maze/Maze.java index f616912..a5a8dde 100644 --- a/src/maze/Maze.java +++ b/src/maze/Maze.java @@ -10,8 +10,7 @@ import dijkstra.VertexInterface; /**

Maze class

*

- * This class describes the maze as a matrix of Boxes ({@link maze.Box}). - * + * This class describes the maze as a matrix of Boxes ({@link maze.Box}). * * @author Antonin Godard * @author Sylvain Rager @@ -30,6 +29,9 @@ public class Maze } + /** + * + */ public int getCost(VertexInterface start, VertexInterface end) { Box startBox = (Box) start ; @@ -51,6 +53,9 @@ public class Maze return dimensionX*dimensionY ; } + /** + * @param ArrayList + */ public ArrayList getVertexes() { ArrayList vertexList = new ArrayList() ; for (int i = 0 ; i < dimensionX ; i++) { @@ -63,6 +68,9 @@ public class Maze return vertexList ; } + /** + * + */ public ArrayList generateNeighbours(VertexInterface vertex) { Box box = (Box)vertex ; diff --git a/src/maze/MazeReadingException.java b/src/maze/MazeReadingException.java index 0bfd24c..4cc5822 100644 --- a/src/maze/MazeReadingException.java +++ b/src/maze/MazeReadingException.java @@ -1,5 +1,12 @@ package maze; +/**

MazeReadingException exception

+ *

+ * This class is used to throw exception when reading and initiating the maze from a text file. + * + * + */ + public class MazeReadingException extends Exception {