Added packages, Previous class and ASet class.

This commit is contained in:
antograb authored and Sylvain Rager (regar42) committed 2017-12-03 20:41:05 +01:00
1 parent f252db5e3d
commit acab098ea1
16 files changed
+99 -5

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
package dijkstra;
import java.util.HashSet;
import maze.Box;
public class ASet implements ASetInterface {
private HashSet<Box> vertexHashSet = new HashSet<Box>() ;
public ASet(HashSet<Box> vertexHashSet) {
this.vertexHashSet = vertexHashSet;
}
public void add(VertexInterface vertex) {
vertexHashSet.add((Box)vertex) ;
}
public boolean contains(VertexInterface vertex) {
for (VertexInterface v: vertexHashSet) {
if (v == vertex) return true ;
}
return false ;
}
}