harpoon.IR.Bytecode
Class OpConstant

java.lang.Object
  extended by harpoon.IR.Bytecode.Operand
      extended by harpoon.IR.Bytecode.OpConstant

public final class OpConstant
extends Operand

OpConstant represents a constant operand of a java bytecode instruction. This would typically be taken from the constant_pool.

OpConstant represents constant pool entries of type CONSTANT_Double, CONSTANT_Float, CONSTANT_Integer, CONSTANT_Long, and CONSTANT_String.

Version:
$Id: OpConstant.java,v 1.7 2005/10/05 16:21:32 salcianu Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>
See Also:
Operand, Instr, ConstantDouble, ConstantFloat, ConstantInteger, ConstantLong, ConstantString, ConstantClass

Field Summary
 
Fields inherited from class harpoon.IR.Bytecode.Operand
arrayFactory
 
Constructor Summary
OpConstant(Code parent, int constant_pool_index)
          Make a new OpConstant from a constant_pool entry.
OpConstant(Object value, HClass type)
          Make a new OpConstant with the specified value and type.
 
Method Summary
 HClass getType()
          Return the HClass type of this Operand.
 Object getValue()
          Return the value of this Operand.
 String toString()
          Return a human-readable representation of this OpConstant.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OpConstant

public OpConstant(Object value,
                  HClass type)
Make a new OpConstant with the specified value and type.


OpConstant

public OpConstant(Code parent,
                  int constant_pool_index)
Make a new OpConstant from a constant_pool entry.

Method Detail

getValue

public Object getValue()
Return the value of this Operand.


getType

public HClass getType()
Return the HClass type of this Operand.


toString

public String toString()
Return a human-readable representation of this OpConstant.

Specified by:
toString in class Operand