TechTrader Bytecode Toolkit

com.techtrader.modules.tools.bytecode
Class NewArrayInstruction

java.lang.Object
  |
  +--com.techtrader.modules.tools.bytecode.Instruction
        |
        +--com.techtrader.modules.tools.bytecode.NewArrayInstruction

public class NewArrayInstruction
extends Instruction

Represents a NEWARRAY instruction, which is used to create new arrays of primitive types.

Author:
Abe White

Fields inherited from class com.techtrader.modules.tools.bytecode.Instruction
_byteIndex, _opcode, _opcodeTypes, _owner
 
Constructor Summary
protected NewArrayInstruction(Code owner)
           
 
Method Summary
 void acceptVisit(BCVisitor visit)
          Accept a visit from a BCVisitor, calling the appropriate methods to notify the visitor that it has entered this entity, and to provide it with the proper callbacks for each sub-entity owned by this object.
protected  void copy(Instruction orig)
           
 boolean equals(Object other)
          Two NEWARRAY instructions are equal if the array type is the same, of if the array type of either is unset.
 Class getArrayType()
          Get the type of array to create.
 int getArrayTypeCode()
          Get the array code used in the lowlevel bytecode.
 String getArrayTypeName()
          Get the type of array to create.
 int getLength()
          Return the length in bytes of this opcode, including all arguments.
protected  void readData(DataInput in)
          Read the arguments for this opcode from the given stream.
 NewArrayInstruction setArrayType(Class type)
          Set the type of array to create.
 void setArrayTypeCode(int code)
          Set the array code used in the lowlevel bytecode.
 NewArrayInstruction setArrayTypeName(String type)
          Set the type of array to create.
protected  void writeData(DataOutput out)
          Write the arguments for this opcode to the given stream.
 
Methods inherited from class com.techtrader.modules.tools.bytecode.Instruction
getByteIndex, getName, getOpCode, getOwner, getStackChange, invalidate, setByteIndex, setOpCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NewArrayInstruction

protected NewArrayInstruction(Code owner)
Method Detail

getArrayTypeCode

public int getArrayTypeCode()
Get the array code used in the lowlevel bytecode.

setArrayTypeCode

public void setArrayTypeCode(int code)
Set the array code used in the lowlevel bytecode.

getArrayType

public Class getArrayType()
Get the type of array to create.

getArrayTypeName

public String getArrayTypeName()
Get the type of array to create.

setArrayType

public NewArrayInstruction setArrayType(Class type)
Set the type of array to create.
Returns:
this Instruction, for method chaining

setArrayTypeName

public NewArrayInstruction setArrayTypeName(String type)
Set the type of array to create.
Returns:
this Instruction, for method chaining

equals

public boolean equals(Object other)
Two NEWARRAY instructions are equal if the array type is the same, of if the array type of either is unset.
Overrides:
equals in class Instruction

getLength

public int getLength()
Description copied from class: Instruction
Return the length in bytes of this opcode, including all arguments. This method should be overridden by opcodes that take arguments.
Overrides:
getLength in class Instruction

copy

protected void copy(Instruction orig)
Overrides:
copy in class Instruction

readData

protected void readData(DataInput in)
                 throws IOException
Description copied from class: Instruction
Read the arguments for this opcode from the given stream. This method should be overridden by opcodes that take arguments.
Overrides:
readData in class Instruction

writeData

protected void writeData(DataOutput out)
                  throws IOException
Description copied from class: Instruction
Write the arguments for this opcode to the given stream. This method should be overridden by opcodes that take arguments.
Overrides:
writeData in class Instruction

acceptVisit

public void acceptVisit(BCVisitor visit)
Description copied from interface: VisitAcceptor
Accept a visit from a BCVisitor, calling the appropriate methods to notify the visitor that it has entered this entity, and to provide it with the proper callbacks for each sub-entity owned by this object.
Overrides:
acceptVisit in class Instruction

TechTrader Bytecode Toolkit