1 package gov.nasa.jpf.jvm; 20 21 import gov.nasa.jpf.JPFException; 22 23 24 29 public class DynamicElementInfo extends ElementInfo { 30 static final int storingDataLength = ElementInfo.storingDataLength; 31 32 public DynamicElementInfo () { 33 } 34 35 public DynamicElementInfo (Fields f, Monitor m) { 36 super(f, m); 37 } 38 39 public int getNumberOfFields () { 40 return getClassInfo().getNumberOfDeclaredInstanceFields(); 41 } 42 43 public FieldInfo getFieldInfo (int fieldIndex) { 44 return getClassInfo().getInstanceField(fieldIndex); 45 } 46 47 protected FieldInfo getFieldInfo (String clsBase, String fname) { 48 FieldInfo fi = getClassInfo().getInstanceField(clsBase, fname); 49 if (fi == null) { 50 throw new JPFException( "class " + getClassInfo().getName() + 51 " has no field " + fname); 52 } 53 return fi; 54 } 55 56 protected ElementInfo getElementInfo (ClassInfo ci) { 57 return this; 60 } 61 62 protected Ref getRef () { 63 return new ObjRef(getIndex()); 64 } 65 } 66 | Popular Tags |