类 FastClass

    • 方法详细资料

      • create

        public static FastClass create​(Class type)
        Constructs a FastClass
        参数:
        type - The class to optimize
        返回:
        The fast class access to the given class
      • invoke

        public Object invoke​(String name,
                             Class[] parameterTypes,
                             Object obj,
                             Object[] args)
                      throws InvocationTargetException
        Access to invoke a method on the class that this fast class handles
        参数:
        name - The name of the method to invoke,
        parameterTypes - The method parameter types
        obj - The instance on which to invoke the method
        args - The parameter arguments
        返回:
        The method result
        抛出:
        InvocationTargetException - Indicates a problem performing invocation
      • invoke

        public Object invoke​(int index,
                             Object obj,
                             Object[] args)
                      throws InvocationTargetException
        Access to invoke a method on the class that this fast class handles by its index
        参数:
        index - The method index
        obj - The instance on which to invoke the method
        args - The parameter arguments
        返回:
        The method result
        抛出:
        InvocationTargetException - Indicates a problem performing invocation
      • newInstance

        public Object newInstance​(Class[] parameterTypes,
                                  Object[] args)
                           throws InvocationTargetException
        Invoke a parameterized constructor
        参数:
        parameterTypes - The parameter types
        args - The parameter arguments to pass along
        返回:
        The constructed instance
        抛出:
        InvocationTargetException - Indicates a problem performing invocation
      • newInstance

        public Object newInstance​(int index,
                                  Object[] args)
                           throws InvocationTargetException
        Invoke a constructor by its index
        参数:
        index - The constructor index
        args - The parameter arguments to pass along
        返回:
        The constructed instance
        抛出:
        InvocationTargetException - Indicates a problem performing invocation
      • getIndex

        public int getIndex​(String name,
                            Class[] parameterTypes)
        Locate the index of a method
        参数:
        name - The method name
        parameterTypes - The method parameter types
        返回:
        The index
      • getIndex

        public int getIndex​(Class[] parameterTypes)
        Locate the index of a constructor
        参数:
        parameterTypes - The constructor parameter types
        返回:
        The index
      • getName

        public String getName()
        Get the wrapped class name
        返回:
        The class name
      • getJavaClass

        public Class getJavaClass()
        Get the wrapped java class reference
        返回:
        The class reference
      • hashCode

        public int hashCode()
        覆盖:
        hashCode 在类中 Object