1 package org.paneris.jammyjoes.mvp; 2 3 import java.util.Collection; 4 import java.util.Iterator; 5 6 7 public class VisitableCollectionAdaptor implements Selection { 8 9 Collection _list; 10 public VisitableCollectionAdaptor(Collection list) { 11 _list = list; 12 } 13 14 public void visitEach(Command command) { 15 for (Iterator iter = _list.iterator(); iter.hasNext();) { 16 command.visit(iter.next()); 17 } 18 } 19 20 }