Support short[] in toString().

git-svn-id: https://samskivert.googlecode.com/svn/trunk@1042 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
mdb
2003-01-31 02:27:01 +00:00
parent 5d10ff9960
commit 4b0fc9777e
@@ -1,5 +1,5 @@
// //
// $Id: StringUtil.java,v 1.51 2003/01/24 00:31:50 mdb Exp $ // $Id: StringUtil.java,v 1.52 2003/01/31 02:27:01 mdb Exp $
// //
// samskivert library - useful routines for java programs // samskivert library - useful routines for java programs
// Copyright (C) 2001 Michael Bayne // Copyright (C) 2001 Michael Bayne
@@ -223,6 +223,17 @@ public class StringUtil
} }
buf.append(closeBox); buf.append(closeBox);
} else if (val instanceof short[]) {
buf.append(openBox);
short[] v = (short[])val;
for (short i = 0; i < v.length; i++) {
if (i > 0) {
buf.append(", ");
}
buf.append(v[i]);
}
buf.append(closeBox);
} else if (val instanceof int[]) { } else if (val instanceof int[]) {
buf.append(openBox); buf.append(openBox);
int[] v = (int[])val; int[] v = (int[])val;