1 21 22 package org.apache.derby.iapi.services.classfile; 23 24 import org.apache.derby.iapi.services.classfile.VMDescriptor; 25 26 import java.io.IOException ; 27 28 43 public final class CONSTANT_Index_info extends ConstantPoolEntry { 44 45 private int i1; 46 private int i2; 47 48 CONSTANT_Index_info(int tag, int i1, int i2) { 49 super(tag); 50 this.i1 = i1; 51 this.i2 = i2; 52 } 53 54 public int hashCode() { 55 return (tag << 16) | ((i1 << 8) ^ i2); 56 } 57 58 public boolean equals(Object other) { 59 if (other instanceof CONSTANT_Index_info) { 60 CONSTANT_Index_info o = (CONSTANT_Index_info) other; 61 62 return (tag == o.tag) && (i1 == o.i1) && (i2 == o.i2); 63 } 64 return false; 65 } 66 67 68 71 void set(int tag, int i1, int i2) { 72 this.tag = tag; 73 this.i1 = i1; 74 this.i2 = i2; 75 } 76 77 int classFileSize() { 78 return 1 + 2 + ((i2 != 0) ? 2 : 0); 80 } 81 82 void put(ClassFormatOutput out) throws IOException { 83 super.put(out); 84 out.putU2(i1); 85 if (i2 != 0) 86 out.putU2(i2); 87 } 88 89 public int getI1() { return i1; } 90 91 public int getI2() { return i2; } 92 } 93 | Popular Tags |