MZTabUtils { public static SplitList<Double> parseDoubleList(String target) { SplitList<String> list = parseStringList(BAR, target); Double value; SplitList<Double> valueList = new SplitList<Double>(BAR); for (String item : list) { value = parseDouble(item); if (value == null) { valueList.clear(); break; } else { valueList.add(value); } } return valueList; }  static boolean isEmpty(String s); static String parseString(String target); static String printDouble(Double value); static Param parseParam(String target); static SplitList<String> parseStringList(char splitChar, String target); static SplitList<Param> parseParamList(String target); static SplitList<String> parseGOTermList(String target); static Integer parseInteger(String target); static Double parseDouble(String target); static SplitList<Double> parseDoubleList(String target); static String parseUnitId(String target); static URL parseURL(String target); static URI parseURI(String target); static SplitList<PublicationItem> parsePublicationItems(String target); static SplitList<SpecRef> parseSpecRefList(Unit unit, String target); static Modification parseModification(Section section, String target); static SplitList<Modification> parseModificationList(Section section, String target);  }
@Test public void testDoubleList() throws Exception { SplitList<Double> valueList; StringBuilder sb = new StringBuilder(); valueList = parseDoubleList(sb.toString()); assertTrue(valueList.size() == 0); sb.append("2.3"); valueList = parseDoubleList(sb.toString()); assertTrue(valueList.size() == 1); sb.append("| 10.2|11.5"); valueList = parseDoubleList(sb.toString()); assertTrue(valueList.size() == 3); sb.append("|1|2|3"); valueList = parseDoubleList(sb.toString()); assertTrue(valueList.size() == 6); sb.append("1000,100"); valueList = parseDoubleList(sb.toString()); assertTrue(valueList.size() == 0); }