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

PUTSTATIC.java

00001 package de.fub.bytecode.generic;
00002 
00003 import de.fub.bytecode.Constants;
00004 import de.fub.bytecode.ExceptionConstants;
00005 
00006 /** 
00007  * PUTSTATIC - Put static field in class
00008  * <PRE>Stack: ..., objectref, value -&gt; ...</PRE>
00009  * OR
00010  * <PRE>Stack: ..., objectref, value.word1, value.word2 -&gt; ...</PRE>
00011  *
00012  * @version $Id: PUTSTATIC.java,v 1.1.1.1 2002/01/24 03:41:41 pserver Exp $
00013  * @author  <A HREF="http://www.inf.fu-berlin.de/~dahm">M. Dahm</A>
00014  */
00015 public class PUTSTATIC extends FieldInstruction
00016   implements ExceptionThrower, PopInstruction {
00017   /**
00018    * Empty constructor needed for the Class.newInstance() statement in
00019    * Instruction.readInstruction(). Not to be used otherwise.
00020    */
00021   PUTSTATIC() {}  
00022   public PUTSTATIC(int index) {
00023     super(Constants.PUTSTATIC, index);
00024   }  
00025   /**
00026    * Call corresponding visitor method(s). The order is:
00027    * Call visitor methods of implemented interfaces first, then
00028    * call methods according to the class hierarchy in descending order,
00029    * i.e., the most specific visitXXX() call comes last.
00030    *
00031    * @param v Visitor object
00032    */
00033   public void accept(Visitor v) {
00034     v.visitExceptionThrower(this);
00035     v.visitStackConsumer(this);
00036     v.visitPopInstruction(this);
00037     v.visitTypedInstruction(this);
00038     v.visitLoadClass(this);
00039     v.visitCPInstruction(this);
00040     v.visitFieldOrMethod(this);
00041     v.visitFieldInstruction(this);
00042     v.visitPUTSTATIC(this);
00043   }  
00044   public int consumeStack(ConstantPoolGen cpg) { return getFieldSize(cpg); }  
00045   public Class[] getExceptions() {
00046     Class[] cs = new Class[1 + ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length];
00047 
00048     System.arraycopy(ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION, 0,
00049              cs, 0, ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length);
00050     cs[ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length] = 
00051       ExceptionConstants.INCOMPATIBLE_CLASS_CHANGE_ERROR;
00052 
00053     return cs;
00054   }  
00055 }

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