-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNode.java
More file actions
85 lines (60 loc) · 1.25 KB
/
Node.java
File metadata and controls
85 lines (60 loc) · 1.25 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*
Node Class
Node class to be used by linked lists, holding generic data.
Project 4
Windows Eclipse IDE
@version 1.0
@author Jarred Hawkins
Nummiform - Shaped like a coin
"We all make choices, but in the end our choices make us."
- Andrew Ryan(1902 - 1960)
*/
public class Node<T> {
private T data;
private Node <T> next;
//****************************************
public Node() {
this(null, null);
}
//****************************************
public Node(T entry){
this(entry, null);
}
//****************************************
public Node(T dataPortion, Node <T> nextNode) {
data = dataPortion;
next = nextNode;
}
//****************************************
/**
*
* @return
*/
public T getData() {
return data;
}
//****************************************
/**
*
* @param newData
*/
public void setData(T newData) {
data = newData;
}
//****************************************
/**
*
* @return
*/
public Node <T> getNextNode() {
return next;
}
//****************************************
/**
*
* @param nextNode
*/
public void setNextNode(Node <T> nextNode) {
next = nextNode;
}
}