1 cananian 1.1.2.1 // HPointer.java, created Thu Dec 10 23:41:19 1998 by cananian 2 cananian 1.1.2.3 // Copyright (C) 1998 C. Scott Ananian <cananian@alumni.princeton.edu> 3 cananian 1.1.2.3 // Licensed under the terms of the GNU GPL; see COPYING for details. 4 cananian 1.1.2.1 package harpoon.ClassFile; 5 cananian 1.1.2.1 6 cananian 1.1.2.4 import harpoon.Util.ArrayFactory; 7 cananian 1.1.2.4 8 cananian 1.1.2.1 /** 9 cananian 1.1.2.1 * The <code>HPointer</code> interface allows us to resolve 10 cananian 1.1.2.1 * pointers to <code>HClass</code>es transparently (and allows us 11 cananian 1.1.2.1 * to demand-load class files, instead of doing them all at once). 12 cananian 1.1.2.1 * 13 cananian 1.1.2.1 * @author C. Scott Ananian <cananian@alumni.princeton.edu> 14 cananian 1.3 * @version $Id: HPointer.java,v 1.3 2002/04/10 03:04:15 cananian Exp $ 15 cananian 1.1.2.1 */ 16 cananian 1.1.2.1 abstract class HPointer { 17 cananian 1.1.2.1 /** Returns a genuine HClass from the (possible) pointer. */ 18 cananian 1.1.2.1 abstract HClass actual(); 19 cananian 1.1.2.1 abstract String getName(); 20 cananian 1.1.2.1 abstract String getDescriptor(); 21 cananian 1.1.2.2 /** 22 cananian 1.1.2.2 * Returns a hashcode value for this HClass. 23 cananian 1.1.2.2 * The hashcode is identical to the hashcode for the class descriptor 24 cananian 1.1.2.2 * string. 25 cananian 1.1.2.2 */ 26 cananian 1.1.2.2 public int hashCode() { return getDescriptor().hashCode(); } 27 cananian 1.1.2.4 28 cananian 1.2.2.1 public static final ArrayFactory<HPointer> arrayFactory = 29 cananian 1.2.2.1 new ArrayFactory<HPointer>() { 30 cananian 1.2.2.1 public HPointer[] newArray(int len) { return new HPointer[len]; } 31 cananian 1.1.2.4 }; 32 cananian 1.2 }