Class MCMethod

  • All Implemented Interfaces:
    IMCMethod

    public class MCMethod
    extends java.lang.Object
    implements IMCMethod
    Base implementation of the IMCMethod interface.

    Methods in this class should not be overridden. If you want to override anything, then implement the IMCMethod interface instead and optionally delegate calls to this class.

    Please do not add utility methods to this class. Use the helper class MethodToolkit if you want to do common utility stuff.

    • Constructor Summary

      Constructors 
      Constructor Description
      MCMethod​(IMCType type, java.lang.String methodName, java.lang.String formalDescriptor, java.lang.Integer modifier, java.lang.Boolean isNative)
      Create a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      java.lang.String getFormalDescriptor()
      Returns the formal descriptor.
      java.lang.String getMethodName()
      Returns the method name not including parameters.
      java.lang.Integer getModifier()
      Returns the modifier used in the Java class file.
      IMCType getType()
      Returns the class this method is declared in.
      int hashCode()  
      java.lang.Boolean isNative()
      Whether this method is native.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • m_type

        private final IMCType m_type
      • m_methodName

        private final java.lang.String m_methodName
      • m_formalDescriptor

        private final java.lang.String m_formalDescriptor
      • m_modifier

        private final java.lang.Integer m_modifier
      • m_isNative

        private final java.lang.Boolean m_isNative
    • Constructor Detail

      • MCMethod

        public MCMethod​(IMCType type,
                        java.lang.String methodName,
                        java.lang.String formalDescriptor,
                        java.lang.Integer modifier,
                        java.lang.Boolean isNative)
        Create a new instance.
        Parameters:
        type - the class that this method is declared in
        methodName - the method name
        formalDescriptor - the formal descriptor, see IMCMethod.getFormalDescriptor()
        modifier - method modifier bit pattern, see IMCMethod.getModifier()
        isNative - whether the method is native, see IMCMethod.isNative()
    • Method Detail

      • getType

        public final IMCType getType()
        Description copied from interface: IMCMethod
        Returns the class this method is declared in.
        Specified by:
        getType in interface IMCMethod
        Returns:
        the class declaring this method
      • getMethodName

        public final java.lang.String getMethodName()
        Description copied from interface: IMCMethod
        Returns the method name not including parameters.

        An example is "mymethod". If the method is native the format is undefined.

        Specified by:
        getMethodName in interface IMCMethod
        Returns:
        the name of this method, or null if unavailable
      • getFormalDescriptor

        public final java.lang.String getFormalDescriptor()
        Description copied from interface: IMCMethod
        Returns the formal descriptor.

        For example, the method descriptor for the method Object mymethod(int i, double d, Thread t) is (IDLjava/lang/Thread;)Ljava/lang/Object;

        Specified by:
        getFormalDescriptor in interface IMCMethod
        Returns:
        the formal method descriptor, or null if unavailable
      • getModifier

        public final java.lang.Integer getModifier()
        Description copied from interface: IMCMethod
        Returns the modifier used in the Java class file.

        Examples of modifiers are "protected", "public", etc.

        See Modifier for more information about the bit pattern and for methods that can be used to decode it.

        Specified by:
        getModifier in interface IMCMethod
        Returns:
        the modifier used in the class file, or null if not available
      • isNative

        public final java.lang.Boolean isNative()
        Description copied from interface: IMCMethod
        Whether this method is native.
        Specified by:
        isNative in interface IMCMethod
        Returns:
        Boolean.TRUE if the method is native, Boolean.FALSE if not, or null if the information is not available
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object