List of utility methods to do Array Convert to
int | arrayToInt(final byte[] array, final int start) Convert the contents of the specified array to an int , starting at an offset of start .
final int lowbits; final int highbits; lowbits = array[start] & MASK_FF; highbits = array[start + 1] & MASK_FF; return ((highbits << 8 | lowbits)); |
String | arrayToJava(double[] v, int off, int len, String name) array To Java String dec = " private static final double[] " + name + " = { "; StringBuilder s = new StringBuilder(); for (int i = 0; i < dec.length(); i++) { s.append(' '); String prefix = s.toString(); s = new StringBuilder(dec); for (int i = 0; i < len; i++) { ... |
String | arrayToJson(int[] x) array To Json StringBuilder sb = new StringBuilder("["); for (int i : x) { if (sb.length() > 1) sb.append(", "); sb.append(i); sb.append("]"); return sb.toString(); ... |
String | arrayToLine(Object[] source) from array to string. if (source == null) { return ""; StringBuffer buff = new StringBuffer(); for (int i = 0; i < source.length; i++) { if (i != 0) { buff.append(","); buff.append(source[i]); return buff.toString(); |
StringBuilder | arrayToLines(String[] lines) array To Lines return arrayToLines(new StringBuilder(), lines); |
String[] | arrayToLowercase(String[] array) Converts an String array to lowercase. String[] copy = new String[array.length]; for (int i = 0; i < array.length; i++) { copy[i] = array[i].toLowerCase(); return copy; |
String | arrayToMatlabStringArray(double da[]) array To Matlab String Array StringBuilder sb = new StringBuilder(); sb.append("["); for (int i = 0; i < da.length; i++) { sb.append(da[i]); if (i + 1 < da.length) sb.append(","); sb.append("]"); ... |
String | arrayToOneLineSpaceDelimitedString(Object obj[]) array To One Line Space Delimited String StringBuilder sb = new StringBuilder(); for (int i = 0; i < obj.length; i++) { sb.append(obj[i] + " "); sb.append("\n"); return sb.toString(); |
String | arrayToQueryString(String key, Object[] arr) array To Query String StringBuilder sb = new StringBuilder(); for (Object o : arr) { sb.append("&" + key + "[]=" + o.toString()); return sb.toString().replaceAll("%5B%5D=", "[]="); |
String | arrayToSeparatedString(final String[] strings, final String separator) DOCUMENT ME! if (strings != null) { final StringBuilder result = new StringBuilder(); for (int i = 0; i < strings.length; i++) { result.append(strings[i]); if ((i + 1) < strings.length) { result.append(separator); return result.toString(); return ""; |