Java Utililty Methods Collection Concatenate

List of utility methods to do Collection Concatenate

Description

The list of methods to do Collection Concatenate are organized into topic(s).

Method

Listconcat(boolean removeDuplicates, Collection firstCollection, Collection... collections)
concat
final List<E> result;
if (removeDuplicates) {
    result = new ArrayList<E>();
    addElements(removeDuplicates, result, firstCollection);
} else {
    result = new ArrayList<E>(firstCollection);
for (Collection<?> collection : collections) {
...
Stringconcat(Collection> classes, String separator)
concat
StringBuilder builder = new StringBuilder();
for (Iterator<Class<?>> it = classes.iterator(); it.hasNext();) {
    builder.append(it.next().getCanonicalName());
    if (it.hasNext()) {
        builder.append(separator);
return builder.toString();
...
Stringconcat(Collection collection, String delimiter)
concat
if (collection == null) {
    return null;
StringBuilder buf = new StringBuilder();
Iterator<E> itr = collection.iterator();
while (itr.hasNext()) {
    buf.append(itr.next().toString());
    if (itr.hasNext()) {
...
Stringconcat(Collection c)
concat
StringBuilder sb = new StringBuilder();
for (String s : c) {
    if (sb.length() > 0) {
        sb.append(",");
    sb.append(s);
return sb.toString();
...
Stringconcat(Collection items)
Concatenate a collection of strings
return (items != null) ? join(null, items.toArray(new String[items.size()])) : null;
Stringconcat(Collection parts, int start, String defaultText)
concat
return concatArray(parts.toArray(new String[parts.size()]), start, defaultText);
Stringconcat(Collection pieces, String delim)
Build a string concatenating the pieces, adding the delim between each.
return concat(pieces, delim, 0, pieces.size());
Collectionconcat(Collection a, Collection b)
concat
Collection<T> result = new ArrayList<>(a.size() + b.size());
result.addAll(a);
result.addAll(b);
return Collections.unmodifiableCollection(result);
Stringconcat(Collection a, int offset, String sep, String start, String end)
concat
StringBuilder sb = new StringBuilder();
sb.append(start);
Iterator<T> it;
for (it = a.iterator(); offset > 0 && it.hasNext(); --offset, it.next())
    ;
if (offset == 0 && it.hasNext()) {
    sb.append(it.next());
    while (it.hasNext()) {
...
Listconcat(Collection first, Collection second)
concat
List<T> objs = new ArrayList<>();
objs.addAll(first);
objs.addAll(second);
return objs;