| Modifier and Type | Field and Description |
|---|---|
| private static int |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private Object | arrayAllocation(BSHArrayDimensions dimensionsNode, Class<T> type, CallStack callstack, Interpreter interpreter)
|
| private Object | arrayNewInstance(Class<T> type, BSHArrayDimensions dimensionsNode, CallStack callstack)
Create an array of the dimensions specified in dimensionsNode. |
| private Object | |
| private Object | constructWithClassBody(Class<T> type, Object[] args, BSHBlock block, CallStack callstack, Interpreter interpreter)
|
| private Object | constructWithInterfaceBody(Class<T> type, Object[] args, BSHBlock body, CallStack callstack, Interpreter interpreter)
|
| public Object | eval(CallStack callstack, Interpreter interpreter)
Overrides bsh. |
| private Object | objectAllocation(BSHAmbiguousName nameNode, BSHArguments argumentsNode, CallStack callstack, Interpreter interpreter)
|
| private Object | objectArrayAllocation(BSHAmbiguousName nameNode, BSHArrayDimensions dimensionsNode, CallStack callstack, Interpreter interpreter)
|
| private Object | primitiveArrayAllocation(BSHPrimitiveType typeNode, BSHArrayDimensions dimensionsNode, CallStack callstack, Interpreter interpreter)
|
| innerClassCount | back to summary |
|---|---|
| private static int innerClassCount | |
| BSHAllocationExpression | back to summary |
|---|---|
| pack-priv BSHAllocationExpression(int id) | |
| arrayAllocation | back to summary |
|---|---|
| private Object arrayAllocation(BSHArrayDimensions dimensionsNode, Class<T> type, CallStack callstack, Interpreter interpreter) throws EvalError | |
| arrayNewInstance | back to summary |
|---|---|
| private Object arrayNewInstance(Class<T> type, BSHArrayDimensions dimensionsNode, CallStack callstack) throws EvalError Create an array of the dimensions specified in dimensionsNode. dimensionsNode may contain a number of "undefined" as well as "defined" dimensions. Background: in Java arrays are implemented in arrays-of-arrays style where, for example, a two dimensional array is a an array of arrays of some base type. Each dimension-type has a Java class type associated with it... so if foo = new int[5][5] then the type of foo is int [][] and the type of foo[0] is int[], etc. Arrays may also be specified with undefined trailing dimensions - meaning that the lower order arrays are not allocated as objects. e.g. if foo = new int [5][]; then foo[0] == null //true; and can later be assigned with the appropriate type, e.g. foo[0] = new int[5]; (See Learning Java, O'Reilly & Associates more background). To create an array with undefined trailing dimensions using the reflection API we must use an array type to represent the lower order (undefined) dimensions as the "base" type for the array creation... Java will then create the correct type by adding the dimensions of the base type to specified allocated dimensions yielding an array of dimensionality base + specified with the base dimensons unallocated. To create the "base" array type we simply create a prototype, zero length in each dimension, array and use it to get its class (Actually, I think there is a way we could do it with Class.forName() but I don't trust this). The code is simpler than the explanation... see below. | |
| constructObject | back to summary |
|---|---|
| private Object constructObject(Class<T> type, Object[] args, CallStack callstack) throws EvalError | |
| constructWithClassBody | back to summary |
|---|---|
| private Object constructWithClassBody(Class<T> type, Object[] args, BSHBlock block, CallStack callstack, Interpreter interpreter) throws EvalError | |
| constructWithInterfaceBody | back to summary |
|---|---|
| private Object constructWithInterfaceBody(Class<T> type, Object[] args, BSHBlock body, CallStack callstack, Interpreter interpreter) throws EvalError | |
| eval | back to summary |
|---|---|
| public Object eval(CallStack callstack, Interpreter interpreter) throws EvalError Overrides bsh. Doc from bsh. This is the general signature for evaluation of a node. | |
| objectAllocation | back to summary |
|---|---|
| private Object objectAllocation(BSHAmbiguousName nameNode, BSHArguments argumentsNode, CallStack callstack, Interpreter interpreter) throws EvalError | |
| objectArrayAllocation | back to summary |
|---|---|
| private Object objectArrayAllocation(BSHAmbiguousName nameNode, BSHArrayDimensions dimensionsNode, CallStack callstack, Interpreter interpreter) throws EvalError | |
| primitiveArrayAllocation | back to summary |
|---|---|
| private Object primitiveArrayAllocation(BSHPrimitiveType typeNode, BSHArrayDimensions dimensionsNode, CallStack callstack, Interpreter interpreter) throws EvalError | |