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

GOTO_W.java

00001 package de.fub.bytecode.generic;
00002 
00003 import java.io.*;
00004 import de.fub.bytecode.util.ByteSequence;
00005 
00006 /** 
00007  * GOTO_W - Branch always (offset, not address)
00008  *
00009  * @version $Id: GOTO_W.java,v 1.1.1.1 2002/01/24 03:41:39 pserver Exp $
00010  * @author  <A HREF="http://www.inf.fu-berlin.de/~dahm">M. Dahm</A>
00011  */
00012 public class GOTO_W extends BranchInstruction implements UnconditionalBranch {
00013   /**
00014    * Empty constructor needed for the Class.newInstance() statement in
00015    * Instruction.readInstruction(). Not to be used otherwise.
00016    */
00017   GOTO_W() {}  
00018   public GOTO_W(InstructionHandle target) {
00019     super(de.fub.bytecode.Constants.GOTO_W, target);
00020     length = 5;
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.visitUnconditionalBranch(this);
00032     v.visitInstructionTargeter(this);
00033     v.visitBranchInstruction(this);
00034     v.visitGOTO_W(this);
00035   }  
00036   /**
00037    * Dump instruction as byte code to stream out.
00038    * @param out Output stream
00039    */
00040   public void dump(DataOutputStream out) throws IOException {
00041     index = getTargetOffset();
00042     out.writeByte(tag);
00043     out.writeInt(index);
00044   }  
00045   /**
00046    * Read needed data (e.g. index) from file.
00047    */
00048   protected void initFromFile(ByteSequence bytes, boolean wide) throws IOException
00049   {
00050     index  = bytes.readInt();
00051     length = 5;
00052   }  
00053 }

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