@Test public void testGetValue() { assertEquals("CHAMBERY should be the value of this line", "CHAMBERY", eVecS1.getValue("ATVST08:CHAMBERY", "ATVST")); assertEquals("CHAMBERY should be the value of this line, even if the " + "specified length is out of range", "CHAMBERY", eVecS1.getValue("ATVST30:CHAMBERY", "ATVST")); }
public String getValue(String line, String target) { int index = line.indexOf(target); int nbchar = Integer.parseInt(line.substring(index + 5, index + 7)); if (index + nbchar + 8 > line.length()) { return line.substring(index + 8, line.length()); } String value = line.substring(index + 8, index + nbchar + 8); return value; }
EdigeoVEC { public String getValue(String line, String target) { int index = line.indexOf(target); int nbchar = Integer.parseInt(line.substring(index + 5, index + 7)); if (index + nbchar + 8 > line.length()) { return line.substring(index + 8, line.length()); } String value = line.substring(index + 8, index + nbchar + 8); return value; } }
EdigeoVEC { public String getValue(String line, String target) { int index = line.indexOf(target); int nbchar = Integer.parseInt(line.substring(index + 5, index + 7)); if (index + nbchar + 8 > line.length()) { return line.substring(index + 8, line.length()); } String value = line.substring(index + 8, index + nbchar + 8); return value; } EdigeoVEC(String path); }
EdigeoVEC { public String getValue(String line, String target) { int index = line.indexOf(target); int nbchar = Integer.parseInt(line.substring(index + 5, index + 7)); if (index + nbchar + 8 > line.length()) { return line.substring(index + 8, line.length()); } String value = line.substring(index + 8, index + nbchar + 8); return value; } EdigeoVEC(String path); void readVECFile(String obj, Visitor visitor); String getValue(String line, String target); }
EdigeoVEC { public String getValue(String line, String target) { int index = line.indexOf(target); int nbchar = Integer.parseInt(line.substring(index + 5, index + 7)); if (index + nbchar + 8 > line.length()) { return line.substring(index + 8, line.length()); } String value = line.substring(index + 8, index + nbchar + 8); return value; } EdigeoVEC(String path); void readVECFile(String obj, Visitor visitor); String getValue(String line, String target);  }