Class MethodType

  • All Implemented Interfaces:
    Constants, RuntimeConstants

    public final class MethodType
    extends Type
    This class represents an Java method type. It overrides the relevant methods in class Type. WARNING: The contents of this source file are not part of any supported API. Code that depends on them does so at its own risk: they are subject to change or removal without notice.
    • Field Detail

      • returnType

        Type returnType
        The return type.
      • argTypes

        Type[] argTypes
        The argument types.
    • Constructor Detail

      • MethodType

        MethodType​(java.lang.String typeSig,
                   Type returnType,
                   Type[] argTypes)
        Construct a method type. Use Type.tMethod to create a new method type.
        See Also:
        Type.tMethod
    • Method Detail

      • getReturnType

        public Type getReturnType()
        Description copied from class: Type
        Return the return type. Only works for method types.
        Overrides:
        getReturnType in class Type
      • getArgumentTypes

        public Type[] getArgumentTypes()
        Description copied from class: Type
        Return the argument types. Only works for method types.
        Overrides:
        getArgumentTypes in class Type
      • equalArguments

        public boolean equalArguments​(Type t)
        Description copied from class: Type
        Check if the type arguments are the same.
        Overrides:
        equalArguments in class Type
        Returns:
        true if both types are method types and the argument types are identical.
      • stackSize

        public int stackSize()
        Description copied from class: Type
        Return the amount of space this type takes up on the Java operand stack. For a method this is equal to the total space taken up by the arguments.
        Overrides:
        stackSize in class Type
      • typeString

        public java.lang.String typeString​(java.lang.String id,
                                           boolean abbrev,
                                           boolean ret)
        Description copied from class: Type
        Convert a Type to a string, if abbrev is true class names are not fully qualified, if ret is true the return type is included.
        Overrides:
        typeString in class Type