com.jeffpalm.basic.bytecode.base
Class Code

java.lang.Object
  extended by com.jeffpalm.basic.bytecode.base.Code
All Implemented Interfaces:
ICode, ICodeGenerator, IMutableCode, IDumpable

public final class Code
extends java.lang.Object
implements IMutableCode


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.jeffpalm.basic.bytecode.ICode
ICode.Iterator
 
Constructor Summary
Code(IConstantPool cp)
           
 
Method Summary
 int append(Instruction instr)
           
 void clear()
           
 void dump(IAppendable out)
           
 void gen(ICodeStream code)
           
 Instruction getAtLabel(int label)
           
 boolean insertAfter(Instruction newInstr, Instruction target)
           
 boolean insertAtLabel(Instruction newInstr, int label)
           
 boolean insertBefore(Instruction newInstr, Instruction target)
           
 Instruction instructions(int i)
           
 ICode.Iterator iterator()
           
 int length()
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Code

public Code(IConstantPool cp)
Method Detail

length

public int length()
Specified by:
length in interface ICode

size

public int size()
Specified by:
size in interface ICode

append

public int append(Instruction instr)
Specified by:
append in interface IMutableCode

instructions

public Instruction instructions(int i)
Specified by:
instructions in interface ICode

getAtLabel

public Instruction getAtLabel(int label)
Specified by:
getAtLabel in interface ICode

insertAfter

public boolean insertAfter(Instruction newInstr,
                           Instruction target)
Specified by:
insertAfter in interface IMutableCode

insertBefore

public boolean insertBefore(Instruction newInstr,
                            Instruction target)
Specified by:
insertBefore in interface IMutableCode

insertAtLabel

public boolean insertAtLabel(Instruction newInstr,
                             int label)
Specified by:
insertAtLabel in interface IMutableCode

iterator

public ICode.Iterator iterator()
Specified by:
iterator in interface ICode

clear

public void clear()
Specified by:
clear in interface IMutableCode

gen

public void gen(ICodeStream code)
         throws java.io.IOException
Specified by:
gen in interface ICodeGenerator
Throws:
java.io.IOException

dump

public void dump(IAppendable out)
Specified by:
dump in interface IDumpable