List of utility methods to do Collection Join
String | join(final Collection join if (toJoin == null) { return null; final String separator = ","; final StringBuffer buf = new StringBuffer(256); final Iterator<String> iterator = toJoin.iterator(); while (iterator.hasNext()) { buf.append(iterator.next()); ... |
String | join(final Collection Joins a collection of values with commas, enclosed by brackets. return join(values, false);
|
String | join(final Collection Joins a collection of header values into a single header value, with a specified specified separator. if (separator == '"' || separator == '\\') { throw new IllegalArgumentException("invalid separator: " + separator); final StringBuilder sb = new StringBuilder(); if (values != null) { for (final String s : values) { if (s != null) { if (sb.length() > 0) { ... |
String | join(final Collection This static method returns a String representing the the concatenation of the input Collection . return join(collection, ""); |
String | join(final Collection A method for joing together a collection of strings using a specified delimiter. if (collection == null || collection.isEmpty()) { return ""; Iterator<T> it = collection.iterator(); StringBuffer buffer = new StringBuffer(it.next().toString()); while (it.hasNext()) { buffer.append(delimiter).append(it.next().toString()); return buffer.toString(); |
String | join(final Collection join if (objs == null || objs.isEmpty()) return ""; Iterator<T> iter = objs.iterator(); StringBuffer buffer = new StringBuffer(iter.next().toString()); while (iter.hasNext()) buffer.append(delimiter).append(iter.next().toString()); return buffer.toString(); |
String | join(final Collection Join elements of any collection with delimiter if (objs == null || objs.isEmpty()) return ""; if (!checkVal(delimiter)) delimiter = ""; Iterator<T> iter = objs.iterator(); StringBuffer buffer = new StringBuffer(); while (iter.hasNext()) { Object o = iter.next(); ... |
String | join(final String d, final Collection extends Object> c) Behaves like Perl's join function. if (d == null) { throw new NullPointerException("The delimiter must not be null"); if (c == null) { throw new NullPointerException("The collection must not be null"); if (c.isEmpty()) { return ""; ... |
String | join(final String delimiter, final Collection> elements) Same as #join(String,Object) but with a java.util.Collection instead of an Array for the elements. if (elements == null || elements.isEmpty()) { return ""; return join(delimiter, elements.toArray(new Object[elements.size()])); |
String | join(final String s, final Collection> c) join final StringBuilder sb = new StringBuilder(); for (final Object o : c) { sb.append(o); sb.append(s); if (c != null && c.size() > 0) { sb.delete(sb.length() - s.length(), sb.length()); return sb.toString(); |