View Javadoc
1 /* file name : Heap.java 2 * authors : Clarence Alston (massClax@hotmail.com) 3 * : Christopher Ellsworth (Chris@ChrisEllsworth.com) 4 * created : 10/29/2002 06:42:39 5 * 6 * modifications: :-) 7 * 8 */ 9 10 package jrre; 11 12 import java.util.HashMap; 13 import jrre.classloader.classfile.pool_entries.*; 14 15 /*** 16 * Structure for containing the all of the instansiated objects 17 * in the enviroment. 18 * 19 * @author Christopher Ellsworth (Chris@chrisellsworth.com) 20 * @author Clerance Alston (massclax@hotmail.com) 21 */ 22 public class ObjectArea { 23 24 private static HashMap objectArea = new HashMap(); 25 26 private static jrre.gui.ObjectAreaGui objectAreaGui; 27 28 public ObjectArea(){ 29 30 31 if(JRRE.guiOn()){ 32 objectAreaGui = new jrre.gui.ObjectAreaGui(); 33 } 34 } 35 36 public static void clear(){ 37 objectAreaGui.clear(); 38 } 39 40 /*** 41 * Adds an object to the heap. 42 * 43 * @param key The constant pool referance for the object to add to the heap. 44 * @param objectToAdd The object to add. 45 */ 46 public static void addObject(String key, jrre.ObjectInstance objectToAdd){ 47 48 objectArea.put(key, objectToAdd); 49 50 if(JRRE.guiOn()) 51 objectAreaGui.addObject(objectToAdd); 52 } 53 54 /*** 55 * Gets an object referance from the heap. 56 * 57 * @return The object that is linked to the supplied 58 * descriptor. 59 */ 60 public static jrre.ObjectInstance getObject(String key){ 61 return (jrre.ObjectInstance)objectArea.get(key); 62 } 63 64 /*** 65 * Removes an object from the heap. 66 * 67 * @param key The constant pool referance for the object to remove 68 * from the heap. 69 */ 70 public void removeObject(CPInfo key){ 71 72 } 73 }

This page was automatically generated by Maven