Add documentation and fix Javadoc warnings

* Describe the aim of the interfaces
* Explain what are the box inherited from Box
* Fix Javadoc warnings by specifying the parameters and returns of the
  methods in the interfaces
This commit is contained in:
regar42 committed 2017-12-10 15:27:57 +01:00
1 parent 8db8b3faad
commit 4d1d3b39a2
10 files changed
+103 -16

No files matched your search

+16 -3
View File
@@ -4,16 +4,29 @@ import java.util.HashSet;
/**
* This is the ASet class as described in the INF101 course of Telecom Paristech.
* The ASet contains vertexes for which the shortest path has already been found (vertexes already examined by the dijkstra algorithm).
*/
public interface ASetInterface {
/** Add a vertex to the ASet */
/**
* Adds a vertex to the set.
* @param vertex
* The element to be added to the set.
*/
public void add(VertexInterface vertex) ;
/** Check if a vertex belongs to ASet */
/**
* Checks if a vertex belongs to the set.
* @param vertex
* The element we must check if it belongs to the set.
* @return <code>true</code> if the element is in the set, <code>false</code> if not.
*/
public boolean contains(VertexInterface vertex) ;
/** Returns the HashSet which represents the ASet. */
/**
* Returns the HashSet which represents the ASet.
* @return A <code>HashSet</code> containing the same elements as in the set.
*/
public HashSet<VertexInterface> getVertexHashSet();
+23 -5
View File
@@ -3,20 +3,38 @@ import java.util.ArrayList;
/**
* This is the Graph class as described in the INF101 course of Telecom Paristech.
*
* Graph contains the representation of all the vertexes, with the information on which vertex(es) a vertex is linked to and at what cost.
*/
public interface GraphInterface {
/** Returns the number of Vertexes. **/
/**
* Gets the number of <code>VertexInterface</code> in the graph.
* @return An integer giving the number of <code>VertexInterface</code> in the graph.
*/
public int getVertexNumber() ;
/** Return the cost between two vertexes. **/
/**
* Gets the cost of the link (if it exists) between two vertexes.
* @param start
* The departure vertex.
* @param end
* The vertex from which we must see the cost of the link to <code>start</code>.
* @return An integer giving the cost of the link between the given <code>VertexInterface</code>.
*/
public int getCost(VertexInterface start, VertexInterface end) ;
/** Returns an list of Vertexes. **/
/**
* Returns all <code>VertexInterface</code> contained in the graph.
* @return An <code>ArrayList</code> of <code>VertexInterface</code>.
*/
public ArrayList<VertexInterface> getVertexes() ;
/** Returns the neighbour list for a given box. */
/**
* Returns the neighbour list for a given <code>VertexInterface</code>.
* @param vertex
* The <code>VertexInterface</code> from which we will seek for neighbours.
* @return An <code>ArrayList</code> of <code>VertexInterface</code>.
*/
public ArrayList<VertexInterface> generateNeighbours(VertexInterface vertex) ;
}
+15 -3
View File
@@ -2,14 +2,26 @@ package dijkstra;
/**
* This is the Pi class as described in the INF101 course of Telecom Paristech.
*
* It contains the path's cost to reach vertexes (typically, from the root of the graph).
*/
public interface PiInterface {
/** Returns the value of pi(v) */
/**
* Gets the cost to reach the given <code>VertexInterface</code>
* @param vertex
* The <code>VertexInterface</code> from which we get the Pi value (cost) to reach it.
* @return An <code>integer</code> giving the Pi value (cost) the reach the <code>VertexInterface</code>.
*
*/
public int getPi(VertexInterface vertex) ;
/** Sets the Pi value of an element */
/**
* Sets the Pi value of an element
* @param i
* The Pi value (cost) to set.
* @param vertex
* The <code>VertexInterface</code> on which the Pi value (cost) is to be set.
*/
public void setPi(int i, VertexInterface vertex) ;
}
+24 -3
View File
@@ -2,15 +2,36 @@ package dijkstra;
import java.util.ArrayList;
/**
* The <code>PreviousInterface</code> contains information about the father (as in the graph's theory) of some <code>VertexInterface</code>.
* The father of a <code>VertexInterface</code> is the <code>VertexInterface</code> used to reach it.
* Typically in Dijkstra, it's the <code>VertexInterface</code> used to reach <code>vertex</code> with the lowest cost.
*/
public interface PreviousInterface {
/** Returns the father of an element */
/**
* Returns the father of a <code>VertexInterface</code>.
* @param vertex
* The <code>VertexInterface</code> from which we get the father (previous <code>VertexInterface</code>).
* @return The direct previous element used to reach <code>vertex</code>.
*/
public VertexInterface getPrevious(VertexInterface vertex) ;
/** Sets the father of an element to another element */
/**
* Sets the father of an element to another element.
* @param father
* The element that will become the father of the other element.
* @param son
* The element that will be assigned a new father.
*/
public void setPrevious(VertexInterface father, VertexInterface son) ;
/**Shortest path from root to a vertex */
/**
* Shortest path from root to a vertex.
* @param vertex
* The vertex to which the shortest path will be computed.
* @return An <code>ArrayList</code> of the <code>VertexInterface</code> used to reach vertex with the lowest cost.
*/
public ArrayList<VertexInterface> getShortestPathTo(VertexInterface vertex) ;
}
+9 -2
View File
@@ -6,9 +6,16 @@ package dijkstra;
*/
public interface VertexInterface {
/** Compare a Vertex to another. */
/**
* Compares a <code>VertexInterface</code> to another.
* @param vertex
* The vertex to which the equality will be tested.
* @return <code>true</code> is the two <code>VertexInterface</code> are the same, <code>false</code> if not.
*/
public boolean compareTo(VertexInterface vertex) ;
/** Returns the Label of the vertex. */
/**
* @return The label of the element.
*/
public String getLabel() ;
}