ist.palcom.base
Class CheckedArray
java.lang.Object
ist.palcom.base.Object
ist.palcom.base.ReadableArray
ist.palcom.base.Array
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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.
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.