01: /*
02: * Created on May 16, 2006
03: */
04: package uk.org.ponder.rsf.components.decorators;
05:
06: import java.util.ArrayList;
07:
08: /** A typesafe list of UIDecorator objects **/
09:
10: public class DecoratorList extends ArrayList {
11: public DecoratorList() {
12: }
13:
14: public DecoratorList(UIDecorator single) {
15: add(single);
16: }
17:
18: public UIDecorator decoratorAt(int i) {
19: return (UIDecorator) get(i);
20: }
21:
22: public boolean add(Object o) {
23: // ensure ClassCastException for non-decorators
24: UIDecorator toadd = (UIDecorator) o;
25: return super.add(toadd);
26: }
27: }
|