+
+ public static class Array extends Object {
+ private int dim;
+ protected Array(Type t) { super(_initHelper(t, 1)); this.dim = 1; }
+ protected Array(Type t, int dim) { super(_initHelper(t, dim)); this.dim = dim; }
+ public Type.Array asArray() { return this; }
+ public boolean isArray() { return true; }
+ public String humanReadable() {
+ String ret = super.internalForm().replace('/', '.');
+ for(int i=0; i<dim; i++) ret += "[]";
+ return ret;
+ }
+ String internalForm() { throw new Error("Type.Array does not have an internalForm()"); }
+ String[] components() { throw new Error("Type.Array does not have components()"); }
+ private static String _initHelper(Type t, int dim) {
+ StringBuffer sb = new StringBuffer(t.descriptor.length() + dim);
+ for(int i=0;i<dim;i++) sb.append("[");
+ sb.append(t.descriptor);
+ return sb.toString();
+ }
+ }
+