Class IntConstant

  • All Implemented Interfaces:
    Value

    public final class IntConstant
    extends Constant
    Represents an integer constant (covers boolean, byte, char, short, int).
    • Constructor Detail

      • IntConstant

        public IntConstant​(int value)
        Creates an integer constant with the given value.
        Parameters:
        value - the integer value
    • Method Detail

      • of

        public static IntConstant of​(int value)
        Creates an integer constant, using cached instances for common values.
        Parameters:
        value - the integer value
        Returns:
        an IntConstant instance
      • getType

        public IRType getType()
        Description copied from interface: Value
        Gets the IR type of this value.
        Returns:
        the IR type
      • getValue

        public Integer getValue()
        Description copied from class: Constant
        Gets the value of this constant.
        Specified by:
        getValue in class Constant
        Returns:
        the constant value
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object