// here, we also identify what parameters should be foldered private Pair<String, Object> processDependentParameter( ComputeParameter par, Hashtable<String, Object> line, Hashtable<String, String> simpleValues) { Pair<String, Object> pair = new Pair<String, Object>(); pair.setA(par.getName()); int lineFolderedSize = foldingParser.getFolderedLineSize(line); String parTemplate = par.getDefaultValue(); foldingParser.setNotList(); foldingParser.checkIsList(parTemplate); boolean isList = foldingParser.getIsList(); if (lineFolderedSize > 1 && isList) { List<String> values = new ArrayList<String>(); for (int i = 0; i < lineFolderedSize; i++) { String value = foldingParser.parseTemplateLineByHand(parTemplate, line, i, simpleValues); values.add(value); } pair.setB(values); } else { String value = foldingParser.parseTemplateLineByHand(parTemplate, line, 0, simpleValues); pair.setB(value); } return pair; }
private Pair<String, Object> processUnweavedLine( String unkey, String unweavedLine, Hashtable<String, Object> values, int i) { Pair<String, Object> pair = new Pair<String, Object>(); Hashtable<String, String> hashtable = prepareSimpleValues(values, i); String value = foldingParser.doByHand(unweavedLine, hashtable); pair.setA(unkey); pair.setB(value); return pair; }
private Pair<String, Object> processUnweavedCollection( String unkey, List<String> unweavedLines, Hashtable<String, Object> values) { Pair<String, Object> pair = new Pair<String, Object>(); List<String> list = new ArrayList<String>(); for (int i = 0; i < unweavedLines.size(); i++) { String input = unweavedLines.get(i); Pair<String, Object> aPair = processUnweavedLine(unkey, input, values, i); list.add((String) aPair.getB()); } pair.setA(unkey); pair.setB(list); return pair; }