List of utility methods to do Comma Separated List
List | commaDelimitedStringToList(String str) comma Delimited String To List if (str == null || str.length() == 0) { return new ArrayList<String>(0); List<String> result = new ArrayList<String>(); String[] pieces = str.split(","); for (String piece : pieces) { result.add(piece); return result; |
List | commaDelimitedToList(String commaDelimited) comma Delimited To List List<String> items = Arrays.asList(commaDelimited.split("\\s*,\\s*")); return items; |
String | commalist(List l) commalist StringBuffer buf = new StringBuffer(); Iterator i = l.iterator(); while (i.hasNext()) { buf.append(i.next().toString()); if (i.hasNext()) buf.append(','); return buf.toString(); ... |
String | commalist(List l) commalist StringBuffer buf = new StringBuffer(); commalist(l, buf); return buf.toString(); |
String | commandToString(List command To String StringBuffer buf = new StringBuffer(); for (Iterator<String> i = args.iterator(); i.hasNext();) { String arg = i.next(); if (buf.length() > 0) buf.append(' '); buf.append(arg); return buf.toString(); ... |
String | commaSeparate(List a_list) Comma separate all the items in the list. return delimitList(a_list, 0, a_list.size(), ","); |
String | commaSeparatedClassNames(final List comma Separated Class Names final StringBuilder buf = new StringBuilder(); int i = 0; for (final Object object : objects) { if (i++ > 0) { buf.append(','); buf.append(object.getClass().getName()); return buf.toString(); |
String | commaSeparatedList(Collection c) comma Separated List StringBuffer text = new StringBuffer(); if (c == null) { return "(empty)"; Iterator i = c.iterator(); while (i.hasNext()) { Object o = i.next(); if (text.length() > 0) { ... |
String | commaSeparatedList(Object... values) creates a comma separated list out of objects in strings String toAdd = ""; for (int i = 0; i < values.length; i++) { if (i == values.length - 1) { toAdd += stringify(values[i]); } else { toAdd += stringify(values[i]) + ", "; return toAdd; |
List | commaSeparatedList(String string) Creates a List of String objects from the given comma-separated String. if (string == null) { return null; List list = new ArrayList(); int index = 0; while ((index = skipWhitespace(string, index)) < string.length()) { int nextIndex; if (string.charAt(index) == '\'') { ... |