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

AtomicData.java

00001 package gov.nasa.arc.ase.jpf.jvm;
00002 
00003 import gov.nasa.arc.ase.util.HashData;
00004 
00005 public class AtomicData {
00006   /**
00007    * The method in which the line step started.
00008    */
00009   public MethodInfo currentMethod;
00010 
00011   /**
00012    * The line at which the line step started.
00013    */
00014   public int line;
00015 
00016   /**
00017    * Set to true if we still are in the same method in which we were
00018    * when the line step started.
00019    */
00020   public boolean inSameMethod;
00021 
00022   /**
00023    * The number of nested soft atomic blocks.
00024    */
00025   public int softAtomicLevel;
00026   
00027   public Object clone() {
00028     AtomicData a = new AtomicData();
00029     
00030     a.currentMethod = currentMethod;
00031     a.line = line;
00032     a.inSameMethod = inSameMethod;
00033     a.softAtomicLevel = softAtomicLevel;
00034 
00035     return a;
00036   }  
00037   public boolean equals(Object o) {
00038     if(o == null) return false;
00039     if(!(o instanceof AtomicData)) return false;
00040 
00041     AtomicData a = (AtomicData)o;
00042 
00043     if(currentMethod != a.currentMethod) return false;
00044     if(line != a.line) return false;
00045     if(inSameMethod != a.inSameMethod) return false;
00046     if(softAtomicLevel != a.softAtomicLevel) return false;
00047 
00048     return true;
00049   }  
00050   /**
00051    * Computes a hash code with the object data.
00052    */
00053   public void hash(HashData hd) {
00054     hd.add(line);
00055     hd.add(inSameMethod ? 1 : 0);
00056     hd.add(softAtomicLevel);
00057   }  
00058   /**
00059    * Returns a hash code for the object.
00060    */
00061   public int hashCode() {
00062     HashData hd = new HashData();
00063 
00064     hash(hd);
00065 
00066     return hd.getValue();
00067   }  
00068 }

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