Class StringConstant

  • All Implemented Interfaces:
    Printable

    public class StringConstant
    extends Constant
    String constant.
    • Constructor Detail

      • StringConstant

        public StringConstant​(ClassInfo classInfo,
                              int stringIndex)
        Constructs a new DoubleConstant instance.
        Parameters:
        classInfo - the ClassInfo instance this constant is part of.
        stringIndex - the constant value index.
    • Method Detail

      • getValue

        public java.lang.String getValue()
                                  throws java.io.IOException
        Gets this constant's value.
        Returns:
        this constant's value.
        Throws:
        java.io.IOException - if the value cannot be resolved.
      • print

        public void print​(ClassPrinter out,
                          ClassContext context)
                   throws java.io.IOException
        Description copied from interface: Printable
        Prints this instance.
        Parameters:
        out - the ClassPrinter instance to print to.
        context - the context of this print invocation.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • resolveSymbol

        public @NonNull java.lang.String resolveSymbol()
                                                throws java.io.IOException
        Description copied from class: Constant
        Resolves the symbol representing this Constant instance.
        Overrides:
        resolveSymbol in class Constant
        Returns:
        the symbol representing this Constant instance.
        Throws:
        java.io.IOException - if the constant cannot be resolved.
      • toString

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