-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNode.java
38 lines (34 loc) · 845 Bytes
/
Node.java
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
/*
* This class maintains the basic structure as in the file for part 1
*/
import java.util.ArrayList;
public class Node {
int nodeId;
int nodeValue;
ArrayList<AdjacencyDetails> adjacencyList = new ArrayList<AdjacencyDetails>();
public int getNodeId() {
return nodeId;
}
public void setNodeId(int nodeId) {
this.nodeId = nodeId;
}
public int getNodeValue() {
return nodeValue;
}
public void setNodeValue(int nodeValue) {
this.nodeValue = nodeValue;
}
public ArrayList<AdjacencyDetails> getAdjacencyList() {
return adjacencyList;
}
public void setAdjacencyList(ArrayList<AdjacencyDetails> adjacencyList) {
this.adjacencyList = adjacencyList;
}
public Node(int nodeId){
this.nodeId = nodeId;
this.nodeValue = Integer.MAX_VALUE;
}
public void addAdjacency(AdjacencyDetails n){
adjacencyList.add(n);
}
}