List of utility methods to do List Transform
List | stringToList(final String stringToTransform) string To List List<String> list = new ArrayList<String>(); String transformingString = stringToTransform; int index; if (transformingString.indexOf(",") != -1) { while ((index = transformingString.indexOf(",")) != -1) { list.add(transformingString.substring(0, index).trim()); transformingString = transformingString.substring(index + 1); list.add(transformingString.trim()); } else if (transformingString.length() != 0) { list.add(transformingString.trim()); return list; |
int[] | transform(final List transform final int[] array = new int[l.size()]; for (int i = 0; i < l.size(); i++) array[i] = l.get(i).intValue(); return array; |
List
| transform(List
transform int size = values.get(0).size(); List<List<Double>> newList = new ArrayList<List<Double>>(size); for (int i = 0; i < size; i++) { newList.add(new ArrayList<Double>()); for (List<Double> list : values) { int index = 0; for (Double float1 : list) { ... |
List | transformCollectionTOList(Collection Transform of Collection to List List<E> collectionList = new ArrayList<E>(); for (E obj : collection) { collectionList.add(obj); return collectionList; |
void | transformContinuouslyVariablesByThreshold(List
transform Continuously Variables By Threshold for (int i = 1; i < data.size(); i++) { List<String> rowData = data.get(i); if (Integer.parseInt(rowData.get(index)) <= threshold) { rowData.set(index, "<=" + threshold); } else { rowData.set(index, ">" + threshold); |
List | transformIntoAList(String... elements) transform Into A List ArrayList<String> list = new ArrayList<String>(elements.length); for (String element : elements) { list.add(element.trim()); return list; |
void | transformNumberedPropertiesToList(Properties props) transform Numbered Properties To List String key = null; String unnumberedKey = null; List<String> keyList = null; List<String> removeKeys = new LinkedList<String>(); Iterator keys = props.keySet().iterator(); Map<String, List<String>> keysLists = new HashMap<String, List<String>>(); while (keys.hasNext()) { key = (String) keys.next(); ... |
String | transformStringListToString(List transform String List To String final StringBuilder sb = new StringBuilder(); for (String line : fileContentAsList) { sb.append(line); sb.append(getSystemLineSeparator()); return sb.toString().trim(); |
List | transformStringToListOfStrings(String line) transform String To List Of Strings if (line == null || line.trim().length() == 0) return (new ArrayList<String>(0)); String[] tokens = line.trim().split("\\s+"); int tokensLength = tokens.length; List<String> result = new ArrayList<String>(tokensLength); for (int index = 0; index < tokensLength; index++) { result.add(tokens[index]); return (result); |
double[] | transformToDoublePrimitiveArray(List Transform to a primitive double array. final double[] doubles = new double[values.size()]; int i = 0; for (final Double d : values) { doubles[i] = d.doubleValue(); i++; return doubles; |