All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class harpoon.Util.HClassUtil

java.lang.Object
   |
   +----harpoon.Util.HClassUtil

public abstract class HClassUtil
extends Object
HClassUtil contains various useful methods for dealing with HClasses that do not seem to belong with the standard HClass methods.

Version:
$Id: HClassUtil.java,v 1.6 1998/10/11 02:37:58 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>

Constructor Index

 o HClassUtil()

Method Index

 o arrayClass(HClass, int)
Make an n-dimensional array class from the given component class.
 o baseClass(HClass)
Return the ultimate component type of an array (that is, after all array dimensions have been stripped off).
 o commonSuper(HClass, HClass)
Find and return the first common superclass of a pair of classes.
 o dims(HClass)
Count the number of dimensions of an array type.
 o parents(HClass)
Create an array describing the inheritance of class hc.

Constructors

 o HClassUtil
 public HClassUtil()

Methods

 o dims
 public static final int dims(HClass hc)
Count the number of dimensions of an array type.

Returns:
0 for a non-array, n for an n-dimensional array type.
 o baseClass
 public static final HClass baseClass(HClass hc)
Return the ultimate component type of an array (that is, after all array dimensions have been stripped off).

Returns:
input class hc if hc is not an array, otherwise a component class c where c is not an array.
 o arrayClass
 public static final HClass arrayClass(HClass hc,
                                       int dims)
Make an n-dimensional array class from the given component class. The parameter dims is the number of array dimensions to add.

 o parents
 public static final HClass[] parents(HClass hc)
Create an array describing the inheritance of class hc.

Returns:
an array, where element 0 is the HClass for java.lang.Object, an the last element is hc.
 o commonSuper
 public static final HClass commonSuper(HClass a,
                                        HClass b)
Find and return the first common superclass of a pair of classes.


All Packages  Class Hierarchy  This Package  Previous  Next  Index