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

ANEWARRAY.java

00001 package de.fub.bytecode.generic;
00002 
00003 import de.fub.bytecode.ExceptionConstants;
00004 
00005 /** 
00006  * ANEWARRAY -  Create new array of references
00007  * <PRE>Stack: ..., count -&gt; ..., arrayref</PRE>
00008  *
00009  * @version $Id: ANEWARRAY.java,v 1.1.1.1 2002/01/24 03:41:38 pserver Exp $
00010  * @author  <A HREF="http://www.inf.fu-berlin.de/~dahm">M. Dahm</A>
00011  */
00012 public class ANEWARRAY extends CPInstruction
00013   implements LoadClass, AllocationInstruction, ExceptionThrower, StackProducer {
00014   /**
00015    * Empty constructor needed for the Class.newInstance() statement in
00016    * Instruction.readInstruction(). Not to be used otherwise.
00017    */
00018   ANEWARRAY() {}  
00019   public ANEWARRAY(int index) {
00020     super(de.fub.bytecode.Constants.ANEWARRAY, index);
00021   }  
00022   /**
00023    * Call corresponding visitor method(s). The order is:
00024    * Call visitor methods of implemented interfaces first, then
00025    * call methods according to the class hierarchy in descending order,
00026    * i.e., the most specific visitXXX() call comes last.
00027    *
00028    * @param v Visitor object
00029    */
00030   public void accept(Visitor v) {
00031     v.visitLoadClass(this);
00032     v.visitAllocationInstruction(this);
00033     v.visitExceptionThrower(this);
00034     v.visitStackProducer(this);
00035     v.visitTypedInstruction(this);
00036     v.visitCPInstruction(this);
00037     v.visitANEWARRAY(this);
00038   }  
00039   public Class[] getExceptions(){
00040     Class[] cs = new Class[1 + ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION.length];
00041 
00042     System.arraycopy(ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION, 0,
00043              cs, 0, ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION.length);
00044     cs[ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION.length] =
00045       ExceptionConstants.NEGATIVE_ARRAY_SIZE_EXCEPTION;
00046     return cs;
00047   }  
00048 }

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