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

FieldInfo.java

00001 package gov.nasa.arc.ase.jpf.jvm;
00002 
00003 import de.fub.bytecode.classfile.Field;
00004 
00005 /**
00006  * Information about a field.
00007  */
00008 public class FieldInfo {
00009   /**
00010    * Name of the field.
00011    */
00012   private String name;
00013 
00014   /**
00015    * Type of the field.
00016    */
00017   private String type;
00018 
00019   /**
00020    * Class the field belongs to.
00021    */
00022   private ClassInfo ci;
00023 
00024   /**
00025    * Static field.
00026    */
00027   private boolean isStatic;
00028 
00029   /**
00030    * Creates a new field info.
00031    */
00032   public FieldInfo(Field f, ClassInfo c) {
00033     name = f.getName();
00034     type = f.getSignature();
00035     ci = c;
00036     isStatic = f.isStatic();
00037   }  
00038   /**
00039    * Returns the name of the field.
00040    */
00041   public String getName() {
00042     return name;
00043   }  
00044   /**
00045    * Returns the type of the field.
00046    */
00047   public String getType() {
00048     return type;
00049   }  
00050   /**
00051    * Returns true if the field is static.
00052    */
00053   public boolean isStatic() {
00054     return isStatic();
00055   }  
00056   /**
00057    * Returns a string representation of the field.
00058    */
00059   public String toString() {
00060     StringBuffer sb = new StringBuffer();
00061     
00062     if(isStatic) sb.append("static ");
00063 
00064     sb.append(Types.getTypeName(type));
00065     sb.append(" ");
00066     sb.append(ci.getName());
00067     sb.append(".");
00068     sb.append(name);
00069 
00070     return sb.toString();
00071   }  
00072 }

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