KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jruby > util > UnsynchronizedStack


1 package org.jruby.util;
2
3 import java.util.ArrayList JavaDoc;
4 import java.util.Collection JavaDoc;
5
6 public class UnsynchronizedStack extends ArrayList JavaDoc {
7     private static final long serialVersionUID = 5627466606696890874L;
8
9     public UnsynchronizedStack() {
10         super();
11     }
12
13     public UnsynchronizedStack(int initialCapacity) {
14         super(initialCapacity);
15     }
16
17     public UnsynchronizedStack(Collection JavaDoc c) {
18         super(c);
19     }
20
21     public void push(Object JavaDoc o) {
22         add(o);
23     }
24     
25     public Object JavaDoc peek() {
26         return get(size() - 1);
27     }
28     
29     public Object JavaDoc pop() {
30         return remove(size() - 1);
31     }
32 }
33
Popular Tags