01: /*
02: * Copyright (c) 2002-2006 by OpenSymphony
03: * All rights reserved.
04: */
05: package com.opensymphony.xwork.util;
06:
07: import java.util.ArrayList;
08: import java.util.List;
09:
10: /**
11: * A Stack that is implemented using a List.
12: *
13: * @author plightbo
14: * @version $Revision: 872 $
15: */
16: public class CompoundRoot extends ArrayList {
17:
18: public CompoundRoot() {
19: }
20:
21: public CompoundRoot(List list) {
22: super (list);
23: }
24:
25: public CompoundRoot cutStack(int index) {
26: return new CompoundRoot(subList(index, size()));
27: }
28:
29: public Object peek() {
30: return get(0);
31: }
32:
33: public Object pop() {
34: return remove(0);
35: }
36:
37: public void push(Object o) {
38: add(0, o);
39: }
40: }
|