Added packages, Previous class and ASet class.
This commit is contained in:
1 parent
f252db5e3d
commit
acab098ea1
16 files changed
+99
-5
No files matched your search
@@ -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 ;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user