Last change
on this file since 8189 was 8189, checked in by kjdon, 20 years ago |
first version of Imperial College's Visualiser code
|
-
Property svn:keywords
set to
Author Date Id Revision
|
File size:
465 bytes
|
Line | |
---|
1 | package vishnu.datablock;
|
---|
2 |
|
---|
3 | public class Node
|
---|
4 | {
|
---|
5 | Node next;
|
---|
6 | int value;
|
---|
7 |
|
---|
8 | public Node(int i, Node n)
|
---|
9 | {
|
---|
10 | value = i;
|
---|
11 | next = n;
|
---|
12 | }
|
---|
13 |
|
---|
14 | public Node(int i)
|
---|
15 | {
|
---|
16 | value = i;
|
---|
17 | next = null;
|
---|
18 | }
|
---|
19 |
|
---|
20 | public Node push(Node n)
|
---|
21 | {
|
---|
22 | if (next != null) next.push(n);
|
---|
23 | else next = n;
|
---|
24 | return this;
|
---|
25 | }
|
---|
26 |
|
---|
27 | public Node pop()
|
---|
28 | {
|
---|
29 | return next;
|
---|
30 | }
|
---|
31 |
|
---|
32 | public int getValue()
|
---|
33 | {
|
---|
34 | return value;
|
---|
35 | }
|
---|
36 |
|
---|
37 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.