-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLineNode.java
More file actions
38 lines (33 loc) · 834 Bytes
/
LineNode.java
File metadata and controls
38 lines (33 loc) · 834 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
//@author Shreyan Wankavala
public class LineNode {
private Person data;
private LineNode next;
/** The constructor wraps a line node around a person using data
*
* @param data = a person
*/
public LineNode(Person data){
this.data = data;
}
/** Signifies the next person in the linked list
*
* @return
*/
public LineNode getNext(){
return this.next;
}
/** Allows you to change the value of the next person in the list using next
*
* @param next = the next person in the list of type LineNode
*/
public void setNext(LineNode next){
this.next = next;
}
/** Returns the data in a given node
*
* @return the data in the node of type Person
*/
public Person getData(){
return data;
}
}