00001 package gov.nasa.arc.ase.jpf.jvm; 00002 00003 public abstract class Ref { 00004 public static final ObjRef NULL = new ObjRef(-1); 00005 00006 int reference; 00007 boolean isClass; 00008 00009 protected Ref(int r, boolean c) { reference = r; isClass = c; } 00010 public abstract Object clone(); 00011 public boolean equals(Object o) { return reference == ((Ref)o).reference && isClass == ((Ref)o).isClass; } 00012 public int getReference() { return reference; } 00013 public int hashCode() { return reference; } 00014 public boolean isClass() { return isClass; } 00015 public boolean isNull() { return reference == -1; } 00016 public String toString() { return (isClass ? "@" : "#") + reference; } 00017 }