1 cananian 1.1.2.1 // ClassDepthMap.java, created Sat Jan 16 21:29:32 1999 by cananian 2 cananian 1.1.2.2 // Copyright (C) 1998 C. Scott Ananian <cananian@alumni.princeton.edu> 3 cananian 1.1.2.2 // Licensed under the terms of the GNU GPL; see COPYING for details. 4 cananian 1.1.2.1 package harpoon.Backend.Maps; 5 cananian 1.1.2.1 6 cananian 1.1.2.1 import harpoon.ClassFile.HClass; 7 cananian 1.1.2.1 8 cananian 1.1.2.1 /** 9 cananian 1.1.2.1 * A <code>ClassDepthMap</code> reports the nesting depth of a given 10 cananian 1.1.2.1 * class, with <code>java.lang.Object</code> given nesting depth 0. 11 cananian 1.1.2.1 * This is used to layout the display structure for fast implementation 12 cananian 1.1.2.1 * of <code>instanceof</code>. 13 cananian 1.1.2.1 * 14 cananian 1.1.2.1 * @author C. Scott Ananian <cananian@alumni.princeton.edu> 15 cananian 1.2 * @version $Id: ClassDepthMap.java,v 1.2 2002/02/25 21:01:55 cananian Exp $ 16 cananian 1.1.2.1 */ 17 cananian 1.1.2.1 public abstract class ClassDepthMap { 18 cananian 1.1.2.1 /** Return the nesting depth of the given class. Not valid for 19 cananian 1.1.2.1 * interface classes. */ 20 cananian 1.1.2.1 public abstract int classDepth(HClass hc); 21 cananian 1.1.2.1 22 cananian 1.1.2.1 /** Returns the maximum nesting depth of any class (dependent on a 23 cananian 1.1.2.1 * given context). */ 24 cananian 1.1.2.1 public abstract int maxDepth(); 25 cananian 1.2 }