- Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathListNode.java
More file actions
Latest commit
executable file
·56 lines (48 loc) · 1.09 KB
/
Copy pathListNode.java
File metadata and controls
executable file
·56 lines (48 loc) · 1.09 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
/* 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.
publicclassListNode
{
privateObjectvalue;
privateListNodeprevious;
privateListNodenext;
// Constructor:
publicListNode(ObjectinitValue, ListNodeinitPrevious,
ListNodeinitNext)
{
value = initValue;
previous = initPrevious;
next = initNext;
}
publicObjectgetValue()
{
returnvalue;
}
publicListNodegetPrevious()
{
returnprevious;
}
publicListNodegetNext()
{
returnnext;
}
publicvoidsetValue(ObjecttheNewValue)
{
value = theNewValue;
}
publicvoidsetPrevious(ListNodetheNewPrev)
{
previous = theNewPrev;
}
publicvoidsetNext(ListNodetheNewNext)
{
next = theNewNext;
}
}