@Test public void testReadTHFile() { HashMap<String, String> thfValue = null; String fname = "EDAB01SE"; try { thfValue = eThf.readTHFile(); assertEquals(fname, thfValue.get("genfname")); assertEquals(fname, thfValue.get("geofname")); assertEquals(fname, thfValue.get("dicfname")); assertEquals(fname, thfValue.get("scdfname")); assertEquals("4", thfValue.get("nbvec")); assertEquals("EDAB01T1", thfValue.get("vecfname_T1")); assertEquals("EDAB01T2", thfValue.get("vecfname_T2")); assertEquals("EDAB01T3", thfValue.get("vecfname_T3")); assertEquals("EDAB01S1", thfValue.get("vecfname_S1")); } catch (FileNotFoundException e) { assertFalse(e.getMessage(), true); } thfValue = null; fname = null; }
public HashMap<String, String> readTHFile() throws FileNotFoundException { EdigeoParser thfParser = new EdigeoParser(thfFile); HashMap<String, String> thfValue = new HashMap<String, String>(); String value = null; String lname = null; while (thfParser.readLine()) { if (thfParser.line.contains(lotName)) { lname = thfParser.getValue(lotName); continue; } if (thfParser.line.contains(genName)) { value = thfParser.getValue(genName); thfValue.put("genfname", lname + value); continue; } if (thfParser.line.contains(geoName)) { value = thfParser.getValue(geoName); thfValue.put("geofname", lname + value); continue; } if (thfParser.line.contains(dicName)) { value = thfParser.getValue(dicName); thfValue.put("dicfname", lname + value); continue; } if (thfParser.line.contains(scdName)) { value = thfParser.getValue(scdName); thfValue.put("scdfname", lname + value); continue; } if (thfParser.line.contains(nbVec)) { value = thfParser.getValue(nbVec); thfValue.put("nbvec", value); continue; } if (thfParser.line.contains(vectName)) { value = thfParser.getValue(vectName); thfValue.put("vecfname_"+value, lname + value); continue; } } thfParser.close(); return thfValue; }
EdigeoTHF { public HashMap<String, String> readTHFile() throws FileNotFoundException { EdigeoParser thfParser = new EdigeoParser(thfFile); HashMap<String, String> thfValue = new HashMap<String, String>(); String value = null; String lname = null; while (thfParser.readLine()) { if (thfParser.line.contains(lotName)) { lname = thfParser.getValue(lotName); continue; } if (thfParser.line.contains(genName)) { value = thfParser.getValue(genName); thfValue.put("genfname", lname + value); continue; } if (thfParser.line.contains(geoName)) { value = thfParser.getValue(geoName); thfValue.put("geofname", lname + value); continue; } if (thfParser.line.contains(dicName)) { value = thfParser.getValue(dicName); thfValue.put("dicfname", lname + value); continue; } if (thfParser.line.contains(scdName)) { value = thfParser.getValue(scdName); thfValue.put("scdfname", lname + value); continue; } if (thfParser.line.contains(nbVec)) { value = thfParser.getValue(nbVec); thfValue.put("nbvec", value); continue; } if (thfParser.line.contains(vectName)) { value = thfParser.getValue(vectName); thfValue.put("vecfname_"+value, lname + value); continue; } } thfParser.close(); return thfValue; } }
EdigeoTHF { public HashMap<String, String> readTHFile() throws FileNotFoundException { EdigeoParser thfParser = new EdigeoParser(thfFile); HashMap<String, String> thfValue = new HashMap<String, String>(); String value = null; String lname = null; while (thfParser.readLine()) { if (thfParser.line.contains(lotName)) { lname = thfParser.getValue(lotName); continue; } if (thfParser.line.contains(genName)) { value = thfParser.getValue(genName); thfValue.put("genfname", lname + value); continue; } if (thfParser.line.contains(geoName)) { value = thfParser.getValue(geoName); thfValue.put("geofname", lname + value); continue; } if (thfParser.line.contains(dicName)) { value = thfParser.getValue(dicName); thfValue.put("dicfname", lname + value); continue; } if (thfParser.line.contains(scdName)) { value = thfParser.getValue(scdName); thfValue.put("scdfname", lname + value); continue; } if (thfParser.line.contains(nbVec)) { value = thfParser.getValue(nbVec); thfValue.put("nbvec", value); continue; } if (thfParser.line.contains(vectName)) { value = thfParser.getValue(vectName); thfValue.put("vecfname_"+value, lname + value); continue; } } thfParser.close(); return thfValue; } EdigeoTHF(String path); }
EdigeoTHF { public HashMap<String, String> readTHFile() throws FileNotFoundException { EdigeoParser thfParser = new EdigeoParser(thfFile); HashMap<String, String> thfValue = new HashMap<String, String>(); String value = null; String lname = null; while (thfParser.readLine()) { if (thfParser.line.contains(lotName)) { lname = thfParser.getValue(lotName); continue; } if (thfParser.line.contains(genName)) { value = thfParser.getValue(genName); thfValue.put("genfname", lname + value); continue; } if (thfParser.line.contains(geoName)) { value = thfParser.getValue(geoName); thfValue.put("geofname", lname + value); continue; } if (thfParser.line.contains(dicName)) { value = thfParser.getValue(dicName); thfValue.put("dicfname", lname + value); continue; } if (thfParser.line.contains(scdName)) { value = thfParser.getValue(scdName); thfValue.put("scdfname", lname + value); continue; } if (thfParser.line.contains(nbVec)) { value = thfParser.getValue(nbVec); thfValue.put("nbvec", value); continue; } if (thfParser.line.contains(vectName)) { value = thfParser.getValue(vectName); thfValue.put("vecfname_"+value, lname + value); continue; } } thfParser.close(); return thfValue; } EdigeoTHF(String path); HashMap<String, String> readTHFile(); }
EdigeoTHF { public HashMap<String, String> readTHFile() throws FileNotFoundException { EdigeoParser thfParser = new EdigeoParser(thfFile); HashMap<String, String> thfValue = new HashMap<String, String>(); String value = null; String lname = null; while (thfParser.readLine()) { if (thfParser.line.contains(lotName)) { lname = thfParser.getValue(lotName); continue; } if (thfParser.line.contains(genName)) { value = thfParser.getValue(genName); thfValue.put("genfname", lname + value); continue; } if (thfParser.line.contains(geoName)) { value = thfParser.getValue(geoName); thfValue.put("geofname", lname + value); continue; } if (thfParser.line.contains(dicName)) { value = thfParser.getValue(dicName); thfValue.put("dicfname", lname + value); continue; } if (thfParser.line.contains(scdName)) { value = thfParser.getValue(scdName); thfValue.put("scdfname", lname + value); continue; } if (thfParser.line.contains(nbVec)) { value = thfParser.getValue(nbVec); thfValue.put("nbvec", value); continue; } if (thfParser.line.contains(vectName)) { value = thfParser.getValue(vectName); thfValue.put("vecfname_"+value, lname + value); continue; } } thfParser.close(); return thfValue; } EdigeoTHF(String path); HashMap<String, String> readTHFile(); public File thfFile; }