00001 package de.fub.bytecode.generic;
00002
00003 import de.fub.bytecode.ExceptionConstants;
00004
00005
00006
00007
00008
00009
00010
00011 public class CHECKCAST extends CPInstruction
00012 implements LoadClass, ExceptionThrower, StackProducer, StackConsumer {
00013
00014
00015
00016
00017 CHECKCAST() {}
00018
00019
00020
00021 public CHECKCAST(int index) {
00022 super(de.fub.bytecode.Constants.CHECKCAST, index);
00023 }
00024
00025
00026
00027
00028
00029
00030
00031
00032 public void accept(Visitor v) {
00033 v.visitLoadClass(this);
00034 v.visitExceptionThrower(this);
00035 v.visitStackProducer(this);
00036 v.visitStackConsumer(this);
00037 v.visitTypedInstruction(this);
00038 v.visitCPInstruction(this);
00039 v.visitCHECKCAST(this);
00040 }
00041
00042
00043 public Class[] getExceptions() {
00044 Class[] cs = new Class[1 + ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION.length];
00045
00046 System.arraycopy(ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION, 0,
00047 cs, 0, ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION.length);
00048 cs[ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION.length] =
00049 ExceptionConstants.CLASS_CAST_EXCEPTION;
00050 return cs;
00051 }
00052 }