Main Page   Packages   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

ObjectInfo.java

00001 package gov.nasa.arc.ase.jpf.jvm;
00002 
00003 import gov.nasa.arc.ase.util.HashData;
00004 import gov.nasa.arc.ase.util.PoolObject;
00005 import java.io.*;
00006 
00007 public class ObjectInfo extends PoolObject {
00008   Monitor mo;               // monitor associated with the object
00009 // ifdef INITIALIZE
00010 
00011 //#endif INITIALIZE
00012   
00013   // creates a new object info
00014   public ObjectInfo() {
00015     mo = new Monitor();
00016   }  
00017 // ifdef INITIALIZE
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 //#else INITIALIZE
00031   public ObjectInfo(Monitor m) {
00032     mo = m;
00033   }  
00034   // creates a clone of the object. it implies creating a clone of the monitor
00035   // as well
00036   public Object clone() {
00037     try{
00038       // creates a basic clone
00039       ObjectInfo oi = (ObjectInfo)super.clone();
00040 
00041       // the new_id is copied by default
00042       // implicit: oi.new_id = new_id;
00043 
00044       // creates a clone of the monitor
00045       oi.mo = (Monitor)mo.clone();
00046 
00047       // returns the newly created object
00048       return oi; 
00049     } catch(CloneNotSupportedException e) {
00050       throw new InternalError(e.toString());
00051     }
00052   }  
00053   public boolean equals(Object obj){
00054     ObjectInfo oi = (ObjectInfo)obj;
00055 
00056 // ifdef INITIALIZE
00057 
00058 //#else INITIALIZE
00059     return mo.equals(oi.mo);
00060 //#endif INITIALIZE
00061   }  
00062   // returns the reference of the monitor associated with the object
00063   public Monitor getMonitor() {
00064     return mo;
00065   }  
00066   public void hash(HashData hd) {
00067     mo.hash(hd);
00068   }  
00069 //#endif INITIALIZE
00070 
00071   public int hashCode() {
00072     return mo.hashCode();
00073   }  
00074 }

Generated at Thu Feb 7 06:50:51 2002 for Bandera by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001