-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNode.java
More file actions
53 lines (45 loc) · 963 Bytes
/
Node.java
File metadata and controls
53 lines (45 loc) · 963 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
/**
* class that creates a node which stores data and has a pointer for the dictionary
*/
package assignment2;
public class Node{
// attribute declarations
private ConfigData element;
private Node next;
/**
* Constructor creates a node with a pointer and an element
* @param elem
*/
public Node (ConfigData elem){
next = null;
element = elem;
}
/**
* method sets the pointer to the next node
* @param node
*/
public void setNext(Node node){
next = node;
}
/**
* method that returns the next node that is being pointed to
* @return node that is being pointed to
*/
public Node getNext(){
return next;
}
/**
* method that returns the element stored within the node
* @return element
*/
public ConfigData getElement(){
return element;
}
/**
* method that returns the score of the node (configuration)
* @return score of node
*/
public int getScore(){
return element.getScore();
}
}