Java Iterable internalSeparate(StringBuilder buff, Iterable args, String separator, String useWhenNone)

Here you can find the source of internalSeparate(StringBuilder buff, Iterable args, String separator, String useWhenNone)

Description

internal Separate

License

LGPL

Declaration

public static void internalSeparate(StringBuilder buff, Iterable<?> args, String separator,
            String useWhenNone) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

import java.util.Iterator;

public class Main {
    public static void internalSeparate(StringBuilder buff, Iterable<?> args, String separator,
            String useWhenNone) {
        Iterator<?> i = args.iterator();
        if (i.hasNext()) {
            for (;;) {
                Object thing = i.next();
                buff.append(thing.toString());
                if (i.hasNext()) {
                    buff.append(separator);
                } else
                    break;
            }//from   ww  w .  ja  va2 s . c o  m
        } else {
            buff.append(useWhenNone);
        }
    }
}

Related

  1. getLongestCommonToken(Iterable iterable, char tokenSeparatorChar)
  2. getMessageString(Iterable msgs)
  3. getUnique(Iterable iterable)
  4. implodeStrings(Iterable strings, String glue)
  5. indexOfSame(Iterable iterable, T obj)
  6. isEmpty(Iterable iterable)
  7. isEmpty(Iterable i)
  8. iterable(final Iterable in)
  9. max(Iterable iterable)