Class ConstantValue


  • public class ConstantValue
    extends AttributeInfo
    The "ConstantValue" attribute, as defined by 4.7.2 of the JVM specification.
    Version:
    1.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int constantValueIndex
      An index into the constant pool that gives the constant value represented by this attribute.
    • Constructor Summary

      Constructors 
      Constructor Description
      ConstantValue​(ClassFile cf, int constantValueIndex)
      CConstructor.
    • Field Detail

      • constantValueIndex

        private int constantValueIndex
        An index into the constant pool that gives the constant value represented by this attribute.
    • Constructor Detail

      • ConstantValue

        public ConstantValue​(ClassFile cf,
                             int constantValueIndex)
        CConstructor.
        Parameters:
        cf - The class file.
        constantValueIndex - The index into the constant pool that gives the constant value represented by this attribute.
    • Method Detail

      • getConstantValueIndex

        public int getConstantValueIndex()
        Returns the index into the constant pool that gives the constant value represented by this attribute.
        Returns:
        The index.
      • getConstantValueAsString

        public java.lang.String getConstantValueAsString()
        Returns the constant's value, as a string.
        Returns:
        The constant's value, as a string.