List of utility methods to do List Join
String | joinColumnArray(List join Column Array if (columnArray == null || columnArray.size() == 0) { return null; StringBuilder column = new StringBuilder(); int columnSize = columnArray.size(); for (int i = 0; i < columnSize; i++) { column.append(columnArray.get(i)); if (i + 1 < columnSize) { ... |
String | joinCommaAnd(List Returns a comma separated list, but the last comma is an "and". int size = objs.size(); if (size == 0) { return ""; } else if (size == 1) { return objs.get(0).toString(); } else { StringBuilder sb = new StringBuilder(); Iterator<T> iter = objs.iterator(); ... |
String | joinCommaSeparatedList(List Joins a list of Strings to a comma separated single String. return joinList(list, ", "); |
String | joinDoubles(List join Doubles String joined = ""; for (double item : list) { joined += item + " "; return joined.trim(); |
String | joinIntegers(List join Integers if (integers == null || integers.isEmpty()) { return ""; StringBuilder buffer = new StringBuilder(); boolean appendToken = false; for (Integer integer : integers) { if (appendToken) { buffer.append(token); ... |
StringBuilder | joinLines(List join Lines StringBuilder builder = new StringBuilder(); for (String line : lines) { builder.append(line); return builder; |
String | joinLinesWithImplicitFinalLine(final List extends CharSequence> lines) Joins the specified collection of lines into a string when the final line is implicitly specified. final StringBuilder sb = new StringBuilder(); for (final CharSequence line : lines) { sb.append(line); sb.append('\n'); return sb.toString(); |
String | joinList(final List Joins the elements using comma as a separator. if (list == null) { return null; return join(list.toArray(new String[0]), ","); |
String | joinList(final List Given a list and some separator string, create a string with the entries in the list joined with the separator. StringBuilder str = new StringBuilder(); for (int i = 0; i < list.size(); i++) { str.append(list.get(i).toString()); if (i < list.size() - 1) { str.append(sep); return str.toString(); ... |
String | joinList(List list, String separator) join List StringBuilder result = new StringBuilder(); for (Object o : list) { if (o == null || o.equals("")) continue; result.append(o.toString()).append(separator); int i = result.lastIndexOf(separator); if (i >= 0) { ... |