1 23 package org.hammurapi.util; 24 25 import java.io.BufferedReader ; 26 import java.io.FileReader ; 27 import java.io.IOException ; 28 import java.util.Iterator ; 29 import java.util.LinkedList ; 30 import java.util.List ; 31 32 import com.pavelvlasov.util.Visitable; 33 import com.pavelvlasov.util.Visitor; 34 35 39 public class InspectorSetModel implements Visitable { 40 private List inspectors=new LinkedList (); 41 42 45 public InspectorSetModel(String fileName) throws IOException { 46 BufferedReader br=new BufferedReader (new FileReader (fileName)); 47 String line; 48 while ((line=br.readLine())!=null) { 49 if (line.trim().length()!=0 && !line.trim().startsWith("#")) { 50 inspectors.add(new InspectorModel(line)); 51 } 52 } 53 } 54 55 public boolean accept(Visitor visitor) { 56 Iterator it=inspectors.iterator(); 57 while (it.hasNext()) { 58 ((Visitable) it.next()).accept(visitor); 59 } 60 return true; 61 } 62 } 63 | Popular Tags |