- public static Type arrayType(Type base) { return arrayType(base,1); }
- public static Type arrayType(Type base, int dim) {
- StringBuffer sb = new StringBuffer(base.descriptor.length() + dim);
- for(int i=0;i<dim;i++) sb.append("[");
- sb.append(base.descriptor);
- return new Type(sb.toString());
- }
-
+ /** Returns a one dimensional array type for the base type <i>base</i>
+ @param base The base type
+ @return A one dimensional array of the base type
+ */
+ public static Type arrayType(Type base) { return arrayType(base, 1); }
+ /** Returns a <i>dim</i> dimensional array type for the base type <i>base</i>
+ @param base The base type
+ @param dim Number if dimensions
+ @return A one dimensional array of the base type
+ */
+ public static Type arrayType(Type base, int dim) { return new Type.Array(base, dim); }
+
+ public Type.Object asObject() { throw new RuntimeException("attempted to use "+this+" as a Type.Object, which it is not"); }
+ public Type.Array asArray() { throw new RuntimeException("attempted to use "+this+" as a Type.Array, which it is not"); }
+ public boolean isObject() { return false; }
+ public boolean isArray() { return false; }
+
+ /** Class representing Object types (any non-primitive type) */