Class ConstantAttribute


  • public class ConstantAttribute
    extends AttributeInfo
    ConstantValue_attribute.
    • Field Detail

      • tag

        public static final java.lang.String tag
        The name of this attribute "ConstantValue".
        See Also:
        Constant Field Values
    • Constructor Detail

      • ConstantAttribute

        ConstantAttribute​(ConstPool cp,
                          int n,
                          java.io.DataInputStream in)
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • ConstantAttribute

        public ConstantAttribute​(ConstPool cp,
                                 int index)
        Constructs a ConstantValue attribute.
        Parameters:
        cp - a constant pool table.
        index - constantvalue_index of ConstantValue_attribute.
    • Method Detail

      • getConstantValue

        public int getConstantValue()
        Returns constantvalue_index.
      • copy

        public AttributeInfo copy​(ConstPool newCp,
                                  java.util.Map<java.lang.String,​java.lang.String> classnames)
        Makes a copy. Class names are replaced according to the given Map object.
        Overrides:
        copy in class AttributeInfo
        Parameters:
        newCp - the constant pool table used by the new copy.
        classnames - pairs of replaced and substituted class names.