Name: rm29839 Date: 11/18/97
Hi, in my free time I'm developing a Command-Line Interpreter for a slightly modified
subset of the Java Language Specification, more specifically all possible expansions of
Expressions and Local Variable Declarations. This I think is a very powerful devolopper
tool for trying out expressions and getting results immediately.
I'm writing all this in Java and I'm basing the interpreter engine on the Reflection library.
This way users will get command-line access to the complete Java library. But as I advance
in the development I've come upon a few shortcomings of the library that I think all
programmers would benefit from if they were implemented.
Here is my wishlist:
* java.lang.Class should have the following method:
public native Class getArrayClass(int[] Dims)
Returns:
* a Class object representing an array with 'Dims.size()' Dimensions of the class
represented by the instance of Class where the method was called.
Example:
Class StringClass=Class.forName("java.lang.String");
int[] Dims={3, 4};
Class StringArrayClass=StringClass.getArrayClass(Dims);
Object StringArray=StringArrayClass.newInstance();
// Ovbiously this seems of little use since it's impossible to initialize
// the array. But that's when the need for an ArrayManager class comes
// into existence.
*class java.util.ArrayManager {
public ArrayManager(Object array) { //?? };
// Returns an array of integers where 'intarr.size()' is the number of dimensions
// and 'intarr[i]' is the length for dimension 'i'.
public native int[] getDims();
// Set values inside the array according to 'Position'.
public native set(int[] Position, Object Value);
// Get values inside the array according to 'Position'.
public native Object get(int[] Position);
}
* The class described avobe would throw the usual kind of Exceptions and hopefuly it could
be smart enough to recognize arrays of primitive types and do the appropriate convertions
to instances of their representative java.lang.Number classes.
I think that's it for now. I hope you take my
(Review ID: 19905)
======================================================================