com.claritysys.jvm.classfile
Class CpRef

java.lang.Object
  extended by com.claritysys.jvm.classfile.CpEntry
      extended by com.claritysys.jvm.classfile.CpRef
All Implemented Interfaces:
java.lang.Cloneable

public final class CpRef
extends CpEntry

A CONSTANT_{Field,Method,InterfaceMethod}Ref entry in the constant pool.


Field Summary
 
Fields inherited from class com.claritysys.jvm.classfile.CpEntry
TAG_CLASS, TAG_DOUBLE, TAG_FIELDREF, TAG_FLOAT, TAG_INTEGER, TAG_INTERFACE_METHODREF, TAG_LONG, TAG_METHODREF, TAG_NAME_AND_TYPE, TAG_STRING, TAG_UTF8
 
Method Summary
 void computeHash()
          Signal the entry to recompute (and store) its hashcode.
 CpClass getCpClass()
           
 CpNameAndType getNameAndType()
           
 int getNonStaticStackSize()
          Get the number of stack parameters specified by the signature.
 int getStackSize()
          Return the amount of stack size in words needed to process this field or method, eg If its a field, this returns 2 if its a long or double, otherwise 1.
 java.lang.String toString()
           
 
Methods inherited from class com.claritysys.jvm.classfile.CpEntry
clone, getIndex, getTag, hashCode, toJavaString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getCpClass

public final CpClass getCpClass()

getNameAndType

public final CpNameAndType getNameAndType()

getStackSize

public int getStackSize()
Return the amount of stack size in words needed to process this field or method, eg If its a field, this returns 2 if its a long or double, otherwise 1.

If its a method this is the sum of the arg sizes.


getNonStaticStackSize

public int getNonStaticStackSize()
Get the number of stack parameters specified by the signature.

The same as the number of arguments, plus 1 for the "this" reference, plus 1 for each long/double argument.

This is needed to produce the argument count for INVOKEINTERFACE methods, which stupidly need that number.


computeHash

public void computeHash()
Description copied from class: CpEntry
Signal the entry to recompute (and store) its hashcode.

The default does nothing.

Overrides:
computeHash in class CpEntry

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright ? 2000-2003 Clarity Systems Group, LLC. All Rights Reserved.