Methods Summary |
---|
public JConstant | getAt(int index)Returns constant pool entry.
return constants[index];
|
public JConstantClass | getConstantClass(int index)Returns constant.
JConstant constant = getAt(index);
if (constant instanceof JConstantClass)
return (JConstantClass) constant;
else
return null;
|
public JConstantNameAndType | getConstantNameAndType(int index)Returns constant.
JConstant constant = getAt(index);
if (constant instanceof JConstantNameAndType)
return (JConstantNameAndType) constant;
else
return null;
|
public JConstantUtf8 | getConstantUtf8(int index)Returns constant.
JConstant constant = getAt(index);
if (constant instanceof JConstantUtf8)
return (JConstantUtf8) constant;
else
return null;
|
public void | parse(java.io.DataInputStream dis)Parses the constant pool.
// note: constants start at index 1
for (int i = 1; i < constants.length; i++) {
int tag = dis.readUnsignedByte();
constants[i] = JConstant.create(tag, this);
constants[i].parse(dis);
// If a Constant_Long_info or Constant_Double_info
// structure is the item in the constant pool table
// at index n, then the next index n+1 must be
// considered invalid and must not be used
if ((tag == JConstant.CONSTANT_DOUBLE) ||
(tag == JConstant.CONSTANT_LONG)) {
i++;
}
}
|