| MyVertex.java |
1 /**
2 * @author Nick Peters
3 * COMP 469 - Search
4 * Creates a randomly generated graph and finds the shortest path between two
5 * random vertices.
6 */
7
8 package search;
9
10 public class MyVertex {
11 private Integer m_value;
12 // Determines whether or not the vertex is on the shortest path.
13 private boolean m_path;
14
15 public MyVertex(int value) {
16 m_value = value;
17 m_path = false;
18 }
19
20 public void setPath() {
21 m_path = true;
22 }
23
24 public boolean getPath() {
25 return m_path;
26 }
27
28 public Integer getValue() {
29 return m_value;
30 }
31
32 public String toString() {
33 return m_value.toString();
34 }
35 }
36