1 package org.paneris.jammyjoes.mvp;
2
3 import java.util.ArrayList;
4
5 import org.melati.poem.Persistable;
6
7
8 public class CollectOverTheTopCommand implements Command {
9
10 ArrayList _list;
11 int _index = 0;
12
13 public CollectOverTheTopCommand(ArrayList list, int size, Context context) {
14 _list = list;
15 _list.ensureCapacity(size);
16 for (int i = 0; i < size; i++) {
17 _list.add(i,new UncheckedProduct((Integer)context.get(new IntegerConverter(), i+"")));
18 }
19 }
20
21 public Object visit(Object visited) {
22 return _list.set(_index++,new UncheckedProduct((Persistable)visited));
23 }
24
25 public void lastInteraction() {
26 }
27
28 }