-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDoubleLinkedNode.java
More file actions
59 lines (49 loc) · 1.45 KB
/
Copy pathDoubleLinkedNode.java
File metadata and controls
59 lines (49 loc) · 1.45 KB
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
public class DoubleLinkedNode {
private Order value;
private DoubleLinkedNode prev;
private DoubleLinkedNode next;
public DoubleLinkedNode(DoubleLinkedNode prev, DoubleLinkedNode next) // Randomized Food
{
this.value = new Order();
this.prev = prev;
this.next = next;
}
public DoubleLinkedNode(House house, int priority, int normal, int saver) // More customized version of the constructor
{
this.value = new Order(house, priority, normal, saver);
this.next = null;
this.prev = null;
}
public DoubleLinkedNode(Order value) // Very simplistic version of the constructor
{
this.value = value;
}
public DoubleLinkedNode getPrev() // Returns previous node
{
return this.prev;
}
public DoubleLinkedNode getNext() // Returns next node
{
return this.next;
}
public Order getValue() // Returns the order the node stores
{
return this.value;
}
public void setNext(DoubleLinkedNode next) // Sets the next node to be another node
{
this.next = next;
}
public void setPrev(DoubleLinkedNode prev) // Sets the previous node to be another node
{
this.prev = prev;
}
public void setValue(Order value) // Sets the node's order value to be another order value
{
this.value = value;
}
public String toString() //
{
return this.value.toString();
}
}