1 28 29 package com.caucho.bytecode; 30 31 import com.caucho.log.Log; 32 33 import java.io.IOException ; 34 import java.util.logging.Logger ; 35 36 39 public class IntegerConstant extends ConstantPoolEntry { 40 static private final Logger log = Log.open(IntegerConstant.class); 41 42 private int _value; 43 44 47 IntegerConstant(ConstantPool pool, int index, int value) 48 { 49 super(pool, index); 50 51 _value = value; 52 } 53 54 57 public int getValue() 58 { 59 return _value; 60 } 61 62 65 void write(ByteCodeWriter out) 66 throws IOException 67 { 68 out.write(ConstantPool.CP_INTEGER); 69 out.writeInt(_value); 70 } 71 72 75 public int export(ConstantPool target) 76 { 77 return target.addInteger(_value).getIndex(); 78 } 79 80 public String toString() 81 { 82 return "IntegerConstant[" + _value + "]"; 83 } 84 } 85 | Popular Tags |