1 21 22 package org.apache.derby.iapi.services.classfile; 23 24 import org.apache.derby.iapi.services.classfile.VMDescriptor; 25 26 import org.apache.derby.iapi.services.sanity.SanityManager; 27 28 import java.io.IOException ; 29 30 31 public abstract class ConstantPoolEntry 32 { 33 34 protected int tag; protected boolean doubleSlot; 37 38 protected int index; 39 40 protected ConstantPoolEntry(int tag) { 41 this.tag = tag; 42 } 43 44 int getIndex() { 45 if (SanityManager.DEBUG) { 46 if (index <= 0) 47 { 48 SanityManager.THROWASSERT("index is expected to be > 0, is " + index); 49 } 50 } 51 return index; 52 } 53 54 void setIndex(int index) { 55 this.index = index; 56 } 57 58 boolean doubleSlot() { 59 return doubleSlot; 60 } 61 62 65 Object getKey() { 66 return this; 67 } 68 69 72 abstract int classFileSize(); 73 74 void put(ClassFormatOutput out) throws IOException { 75 out.putU1(tag); 76 } 77 78 81 82 86 final int getTag() { 87 return tag; 88 } 89 90 102 int getI1() { return 0; } 103 104 114 int getI2() { return 0; }; 115 } 116 117 | Popular Tags |