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:
|
public class Queue<E> {
private int size;
private Entry<E> firstEntry;
private Entry<E> lastEntry;
public Queue() {
this.firstEntry = null;
this.lastEntry = null;
}
public int size() {
return this.size;
}
}
public class Entry<E> {
private E element;
private Entry<E> next;
public Entry(E o, Entry<E> next) {
this.element = o;
this.next = next;
}
public E getElement() {
return this.element;
}
public void setElement(E element) {
this.element = element;
}
public Entry<E> getNext() {
return this.next;
}
public void setNext(Entry<E> next) {
this.next = next;
}
}
|