ist.palcom.base
Class CheckedArray

java.lang.Object
  extended by ist.palcom.base.Object
      extended by ist.palcom.base.ReadableArray
          extended by ist.palcom.base.Array
              extended by ist.palcom.base.CheckedArray

public class CheckedArray
extends Array

This class can be used to implement Java-style type checked arrays. It is subclassed by the 'Object createCheckedArrayClass' primitive. The primitive generates a new class if one does not already exist. The new class has an instance method called type, which returns the class or symbol-representing-interface which elements in this array must conform to.


Constructor Summary
CheckedArray(int size, Class c)
          Returns a new array that can contain only instances of subclasses of c.
CheckedArray(size size, Method m)
          Returns a new array that can contain only instances that implement the m method (m is a symbol)
 
Method Summary
 Class getClass(Object thing)
          Returns a new array class whose instances can contain only instances of subclasses of specified thing.
 
Methods inherited from class ist.palcom.base.Array
at, putAll, sort, sortFrom
 
Methods inherited from class ist.palcom.base.ReadableArray
at, length
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CheckedArray

public CheckedArray(size size,
                    Method m)
Returns a new array that can contain only instances that implement the m method (m is a symbol)

Parameters:
size - size of new array.
m - Method method

CheckedArray

public CheckedArray(int size,
                    Class c)
Returns a new array that can contain only instances of subclasses of c.

Parameters:
size - int size of new array.
c - Class class that element of new array must be instances of.
Method Detail

getClass

public Class getClass(Object thing)
Returns a new array class whose instances can contain only instances of subclasses of specified thing.

Parameters:
thing - Object (class or method)
Returns:
Class a type checked array class.