Java Array Dump dumpArray(T[] ts)

Here you can find the source of dumpArray(T[] ts)

Description

dump Array

License

Open Source License

Declaration

public static <T> String dumpArray(T[] ts) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static <T> String dumpArray(T[] ts) {
        if (ts == null) {
            return "NULL ARRAY";
        }/*from w w w  .j  a va 2s. co  m*/
        StringBuilder sb = new StringBuilder();
        int num = 0;
        for (T t : ts) {
            sb.append(t);
            if (num != ts.length - 1) {
                sb.append(", ");
            }
            num++;
        }
        return sb.toString();
    }
}

Related

  1. dump_octets(byte[] oct)
  2. dump_strarr(String[] arr, String doc)
  3. dumpArray(final float[] array, final int maxElemsPerLine)
  4. dumpArray(String msg, float[][] A, int x1, int x2, int y1, int y2)
  5. dumpArray(String msg, Object[] refs)
  6. dumpArrayHex(byte b[])
  7. dumpAsciiChars(byte[] b, int blen)
  8. dumpAsHex(byte[] byteBuffer, int length)
  9. dumpAsHex(byte[] src, int length)