-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNode.java
More file actions
60 lines (46 loc) · 943 Bytes
/
Node.java
File metadata and controls
60 lines (46 loc) · 943 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package ds;
import java.util.List;
/**
* Standard representation of a Node. Should remove adjNodes from it.
*
* @author shivam.maharshi
*/
public class Node {
private int id;
private int level;
private State state;
private List<Node> adjNodes;
public Node(int id) {
this(id, null);
}
public Node(int id, List<Node> nodes) {
this.id = id;
this.adjNodes = nodes;
this.level = 0;
this.state = State.UNVISITED;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getLevel() {
return level;
}
public void setLevel(int level) {
this.level = level;
}
public List<Node> getAdjNodes() {
return adjNodes;
}
public void setAdjNodes(List<Node> adjNodes) {
this.adjNodes = adjNodes;
}
public State getState() {
return state;
}
public void setState(State state) {
this.state = state;
}
}