/** * @see Iterate#appendString(Iterable, Appendable) */ public static <T> void appendString(T[] array, Appendable appendable) { ArrayIterate.appendString(array, appendable, ", "); }
/** * @see Iterate#makeString(Iterable, String, String, String) */ public static <T> String makeString(T[] array, String start, String separator, String end) { Appendable stringBuilder = new StringBuilder(); ArrayIterate.appendString(array, stringBuilder, start, separator, end); return stringBuilder.toString(); }
/** * @see Iterate#appendString(Iterable, Appendable, String, String, String) */ public static <T> void appendString( T[] array, Appendable appendable, String start, String separator, String end) { try { appendable.append(start); if (array.length > 0) { appendable.append(String.valueOf(array[0])); int size = array.length; for (int i = 1; i < size; i++) { appendable.append(separator); appendable.append(String.valueOf(array[i])); } } appendable.append(end); } catch (IOException e) { throw new RuntimeException(e); } }
/** * @see Iterate#appendString(Iterable, Appendable) */ public static <T> void appendString(T[] array, Appendable appendable) { ArrayIterate.appendString(array, appendable, ", "); }
/** * @see Iterate#makeString(Iterable, String, String, String) */ public static <T> String makeString(T[] array, String start, String separator, String end) { Appendable stringBuilder = new StringBuilder(); ArrayIterate.appendString(array, stringBuilder, start, separator, end); return stringBuilder.toString(); }
/** * @see Iterate#appendString(Iterable, Appendable, String, String, String) */ public static <T> void appendString( T[] array, Appendable appendable, String start, String separator, String end) { try { appendable.append(start); if (array.length > 0) { appendable.append(String.valueOf(array[0])); int size = array.length; for (int i = 1; i < size; i++) { appendable.append(separator); appendable.append(String.valueOf(array[i])); } } appendable.append(end); } catch (IOException e) { throw new RuntimeException(e); } }