Java Utililty Methods List Join

List of utility methods to do List Join

Description

The list of methods to do List Join are organized into topic(s).

Method

Stringjoin(Iterable list, String delimiter)
Joins the Strings of the provided array into a single String.
if (list == null) {
    return "";
StringBuilder builder = new StringBuilder();
Iterator<String> iter = list.iterator();
while (iter.hasNext()) {
    builder.append(iter.next());
    if (!iter.hasNext()) {
...
Listjoin(List a, List b)
Used by common.ext.
List l = new ArrayList();
if (a != null) {
    l.addAll(a);
if (b != null) {
    l.addAll(b);
return l;
...
Stringjoin(List a_quotedArgs)
join
StringBuffer joined = new StringBuffer();
int quotedSize = a_quotedArgs.size();
for (int index = 0; index < quotedSize; index++) {
    if (index > 0) {
        joined.append(' ');
    joined.append(a_quotedArgs.get(index));
return joined.toString();
Stringjoin(List array, String separator)
join
if (array == null) {
    return null;
if (separator == null) {
    separator = EMPTY;
StringBuffer buf = new StringBuffer();
for (int i = 0; i < array.size(); i++) {
...
Stringjoin(List elements, String joinWith)
join
if (elements == null || elements.size() == 0)
    return null;
StringBuilder buffer = new StringBuilder(56);
for (Iterator i$ = elements.iterator(); i$.hasNext(); buffer.append(joinWith)) {
    String str = (String) i$.next();
    buffer.append(str);
return buffer.toString();
...
Stringjoin(List elements, String sep)
"join" a List of Strings into a single string, with each string separated by a defined separator string.
StringBuffer sb = new StringBuffer();
boolean first = true;
Iterator iter = elements.iterator();
while (iter.hasNext()) {
    String element = (String) iter.next();
    if (!first) {
        sb.append(sep);
    } else {
...
Stringjoin(List items, String separator)
join
StringBuilder sb = new StringBuilder();
for (int i = 0; i < items.size(); i++) {
    boolean lastItem = i == items.size() - 1;
    sb.append(items.get(i));
    if (!lastItem) {
        sb.append(separator);
return sb.toString();
Stringjoin(List l, String sep)
join
String[] fields = (String[]) l.toArray(new String[l.size()]);
return join(fields, sep);
Stringjoin(List list, char separator)
join
if (list == null) {
    return "";
int size = list.size();
if (size == 0) {
    return "";
if (size == 1) {
...
Stringjoin(List list, String delim)
join
if (list == null || list.size() < 1)
    return null;
StringBuffer buf = new StringBuffer();
Iterator i = list.iterator();
while (i.hasNext()) {
    buf.append((String) i.next());
    if (i.hasNext())
        buf.append(delim);
...