input = new LineNumberReader(new InputStreamReader(new FileInputStream("PETScRun.examples"))); line = null; String dir = null,sec; while (true) { try { line = input.readLine(); } catch (java.io.IOException e) {break;} if (line == null) break; if (line.length() == 0) continue; if (line.charAt(0) == '#') continue; System.out.println(line); if (line.startsWith("src")) {  if (dir != null) { systems[EXAMPLES].put(dir,examples); systems[EXAMPLESHELP].put(dir,exampleshelp); dir = null; }  int i = line.indexOf(' '); dir = line.substring(0,i-1); sec = line.substring(i+1); examples     = new ArrayList(); exampleshelp = new ArrayList(); } else {  examples.add(line.substring(0,line.indexOf('.'))); int i = line.indexOf(' '); if (i > 0) { sec = line.substring(i+1); } else { sec = null; } exampleshelp.add(sec); } } if (dir != null) { systems[EXAMPLES].put(dir,examples); systems[EXAMPLESHELP].put(dir,exampleshelp); }
if (examples != null) { System.out.println("putting directory "+edirectory); systems[EXAMPLES].put(edirectory,examples); }
  public Hashtable[] load() throws java.io.IOException  {    String           edirectory = null;    ArrayList        examples = null,exampleshelp = null;           systems = new Hashtable[5];    systems[MACHINE]       = new Hashtable();    systems[DIRECTORY]     = new Hashtable();    systems[MAXNP]         = new Hashtable();    systems[EXAMPLES]      = new Hashtable();    systems[EXAMPLESHELP]  = new Hashtable();    LineNumberReader input = new LineNumberReader(new InputStreamReader(new FileInputStream("PETScRun.systems")));    String line = null;    while (true) {      try {        line = input.readLine();      } catch (java.io.IOException e) {break;}      if (line == null) break;      if (line.length() == 0) continue;      if (line.charAt(0) == '#') continue;      System.out.println(line);      java.util.StringTokenizer toke = new java.util.StringTokenizer(line.trim());      int cnt = toke.countTokens();      if (cnt == 4) { /* found a new machine arch */	String arch = toke.nextToken();        systems[MACHINE].put(arch,toke.nextToken());        systems[DIRECTORY].put(arch,toke.nextToken());        systems[MAXNP].put(arch,toke.nextToken());      }    }    input = new LineNumberReader(new InputStreamReader(new FileInputStream("PETScRun.examples")));    line = null;    String dir = null,sec;    while (true) {      try {        line = input.readLine();      } catch (java.io.IOException e) {break;}      if (line == null) break;      if (line.length() == 0) continue;      if (line.charAt(0) == '#') continue;      System.out.println(line);      if (line.startsWith("src")) {        /* save information from previous directory */        if (dir != null) {          systems[EXAMPLES].put(dir,examples);          systems[EXAMPLESHELP].put(dir,exampleshelp);          dir = null;        }        /* we have a new directory */	int i = line.indexOf(' ');        dir = line.substring(0,i-1);        sec = line.substring(i+1);        examples     = new ArrayList();        exampleshelp = new ArrayList();      } else {          /* we have a new example */        examples.add(line.substring(0,line.indexOf('.')));	int i = line.indexOf(' ');        if (i > 0) {          sec = line.substring(i+1);        } else {	  sec = null;        }        exampleshelp.add(sec);      }    }    if (dir != null) {      systems[EXAMPLES].put(dir,examples);      systems[EXAMPLESHELP].put(dir,exampleshelp);    }    return systems;  }