bluej.extensions
Class BArray

java.lang.Object
  extended by bluej.extensions.BArray

public class BArray
extends java.lang.Object

A wrapper for an array object in BlueJ. Behaviour is similar to the Java reflection API.

Author:
Damiano Bolla, University of Kent at Canterbury, 2003

Constructor Summary
BArray()
           
 
Method Summary
static java.lang.Object getValue(BObject thisArray, int itemIndex)
          Given a BlueJ array object, returns the item at the given index.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BArray

public BArray()
Method Detail

getValue

public static java.lang.Object getValue(BObject thisArray,
                                        int itemIndex)
                                 throws ProjectNotOpenException,
                                        PackageNotFoundException
Given a BlueJ array object, returns the item at the given index. In the case that the array contains elements of primitive type (int etc.), the return value is of the appropriate Java wrapper type (Integer etc.). In the case that the array is composed of BlueJ objects (including nested arrays) then an appropriate BObject will be returned.

Parameters:
thisArray - This must be an array object of which you want the given item.
itemIndex - The index in the array where you want to peek.
Returns:
an Object that encapsulate the specific item or null if not an array.
Throws:
ProjectNotOpenException - if the project to which this array belongs has been closed by the user.
PackageNotFoundException - if the package to which this array belongs has been deleted by the user.


BlueJ homepage