-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIntNodeTwo.java
More file actions
68 lines (60 loc) · 1.27 KB
/
IntNodeTwo.java
File metadata and controls
68 lines (60 loc) · 1.27 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
60
61
62
63
64
65
66
67
68
/**
* Write a description of class IntNodeTwo here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class IntNodeTwo
{
// instance variables - replace the example below with your own
private int _num;
private IntNodeTwo _next, _prev;
/**
* Constructor for objects of class IntNodeTwo
*/
public IntNodeTwo(int n)
{
// initialise instance variables
_num = n;
_next = null;
_prev = null;
}
public IntNodeTwo(int num, IntNodeTwo n, IntNodeTwo p)
{
// initialise instance variables
_num = num;
_next = n;
_prev = p;
}
/**
* An example of a method - replace this comment with your own
*
* @param y a sample parameter for a method
* @return the sum of x and y
*/
public int getNum()
{
// put your code here
return _num;
}
public IntNodeTwo getNext()
{
return _next;
}
public IntNodeTwo getPrev()
{
return _prev;
}
public void setNum(int n)
{
_num = n;
}
public void setNext(IntNodeTwo node)
{
_next = node;
}
public void setPrev(IntNodeTwo node)
{
_prev = node;
}
}