-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathListNode.java
executable file
·56 lines (48 loc) · 1.09 KB
/
ListNode.java
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
/* Librarian Assistant Pro - Version 1.7
* Class: DoublyLinkedList
* Duties:
* Instance of this class is a node. Node contains
* a value and two more nodes within itself
* this class is used to store Title and Magazine
* Objects
* Date: September 2008
*/
// Represents a node of a doubly-linked list.
public class ListNode
{
private Object value;
private ListNode previous;
private ListNode next;
// Constructor:
public ListNode(Object initValue, ListNode initPrevious,
ListNode initNext)
{
value = initValue;
previous = initPrevious;
next = initNext;
}
public Object getValue()
{
return value;
}
public ListNode getPrevious()
{
return previous;
}
public ListNode getNext()
{
return next;
}
public void setValue(Object theNewValue)
{
value = theNewValue;
}
public void setPrevious(ListNode theNewPrev)
{
previous = theNewPrev;
}
public void setNext(ListNode theNewNext)
{
next = theNewNext;
}
}