Class ConstantCP

    • Field Detail

      • class_index

        @Deprecated
        protected int class_index
        Deprecated.
        (since 6.0) will be made private; do not access directly, use getter/setter
      • name_and_type_index

        @Deprecated
        protected int name_and_type_index
        Deprecated.
        (since 6.0) will be made private; do not access directly, use getter/setter
    • Constructor Detail

      • ConstantCP

        public ConstantCP​(ConstantCP c)
        Initialize from another object.
      • ConstantCP

        protected ConstantCP​(byte tag,
                             int class_index,
                             int name_and_type_index)
        Parameters:
        class_index - Reference to the class containing the field
        name_and_type_index - and the field signature
    • Method Detail

      • getClassIndex

        public final int getClassIndex()
        Returns:
        Reference (index) to class this constant refers to.
      • setClassIndex

        public final void setClassIndex​(int class_index)
        Parameters:
        class_index - points to Constant_class
      • getNameAndTypeIndex

        public final int getNameAndTypeIndex()
        Returns:
        Reference (index) to signature of the field.
      • setNameAndTypeIndex

        public final void setNameAndTypeIndex​(int name_and_type_index)
        Parameters:
        name_and_type_index - points to Constant_NameAndType
      • getClass

        public String getClass​(ConstantPool cp)
        Returns:
        Class this field belongs to.
      • toString

        public String toString()
        Overrides:
        toString in class Constant
        Returns:
        String representation. not final as ConstantInvokeDynamic needs to modify