Class MethodPtrs

java.lang.Object
org.jfuncmachine.compiler.model.MethodPtrs

public class MethodPtrs extends Object
Utilities for creating pointers/references to methods, including constructors and interface methods
  • Method Details

    • makeJavaConstructorPtr

      public static Expression makeJavaConstructorPtr(String className, Type[] parameterTypes)
      Create a pointer to a Java constructor
      Parameters:
      className - The name of the class to create
      parameterTypes - The constructor parameters
      Returns:
      A lambda that invokes the constructor
    • makeJavaConstructorPtr

      public static Expression makeJavaConstructorPtr(String className, Type[] parameterTypes, String filename, int lineNumber)
      Create a pointer to a Java constructor
      Parameters:
      className - The name of the class to create
      parameterTypes - The constructor parameters
      filename - The source file where this pointer is created
      lineNumber - The line number in the source file where this pointer is created
      Returns:
      A lambda that invokes the constructor
    • makeJavaInterfaceMethodPtr

      public static Expression makeJavaInterfaceMethodPtr(String interfaceName, String methodName, Type[] parameterTypes, Type returnType, Expression target)
      Create a pointer to a Java interface method
      Parameters:
      interfaceName - The name of the Java interface containing the method
      methodName - The name of the method to point to
      parameterTypes - The types of the method parameters
      returnType - The method return type
      target - The object this method should be invoked on
      Returns:
      A lambda that invokes the interface method
    • makeJavaInterfaceMethodPtr

      public static Expression makeJavaInterfaceMethodPtr(String interfaceName, String methodName, Type[] parameterTypes, Type returnType)
      Create a pointer to a Java interface method that also requires the target object to be passed in
      Parameters:
      interfaceName - The name of the Java interface containing the method
      methodName - The name of the method to point to
      parameterTypes - The types of the method parameters
      returnType - The method return type
      Returns:
      A lambda that invokes the interface method
    • makeJavaInterfaceMethodPtr

      public static Expression makeJavaInterfaceMethodPtr(String interfaceName, String methodName, Type[] parameterTypes, Type returnType, Expression target, String filename, int lineNumber)
      Create a pointer to a Java interface method
      Parameters:
      interfaceName - The name of the Java interface containing the method
      methodName - The name of the method to point to
      parameterTypes - The types of the method parameters
      returnType - The method return type
      target - The object this method should be invoked on
      filename - The source file where this pointer is created
      lineNumber - The line number in the source file where this pointer is created
      Returns:
      A lambda that invokes the interface method
    • makeJavaInterfaceMethodPtr

      public static Expression makeJavaInterfaceMethodPtr(String interfaceName, String methodName, Type[] parameterTypes, Type returnType, String filename, int lineNumber)
      Create a pointer to a Java interface method that also requires the target object to be passed in
      Parameters:
      interfaceName - The name of the Java interface containing the method
      methodName - The name of the method to point to
      parameterTypes - The types of the method parameters
      returnType - The method return type
      filename - The source file where this pointer is created
      lineNumber - The line number in the source file where this pointer is created
      Returns:
      A lambda that invokes the interface method
    • makeJavaMethodPtr

      public static Expression makeJavaMethodPtr(String className, String methodName, Type[] parameterTypes, Type returnType, Expression target)
      Create a pointer to a Java method
      Parameters:
      className - The name of the Java class containing the method
      methodName - The name of the method to point to
      parameterTypes - The types of the method parameters
      returnType - The method return type
      target - The object this method should be invoked on
      Returns:
      A lambda that invokes the interface method
    • makeJavaMethodPtr

      public static Expression makeJavaMethodPtr(String className, String methodName, Type[] parameterTypes, Type returnType, Expression target, String filename, int lineNumber)
      Create a pointer to a Java method
      Parameters:
      className - The name of the Java class containing the method
      methodName - The name of the method to point to
      parameterTypes - The types of the method parameters
      returnType - The method return type
      target - The object this method should be invoked on
      filename - The source file where this pointer is created
      lineNumber - The line number in the source file where this pointer is created
      Returns:
      A lambda that invokes the interface method
    • makeJavaMethodPtr

      public static Expression makeJavaMethodPtr(String className, String methodName, Type[] parameterTypes, Type returnType)
      Create a pointer to a Java method
      Parameters:
      className - The name of the Java class containing the method
      methodName - The name of the method to point to
      parameterTypes - The types of the method parameters
      returnType - The method return type
      Returns:
      A lambda that invokes the interface method
    • makeJavaMethodPtr

      public static Expression makeJavaMethodPtr(String className, String methodName, Type[] parameterTypes, Type returnType, String filename, int lineNumber)
      Create a pointer to a Java method
      Parameters:
      className - The name of the Java class containing the method
      methodName - The name of the method to point to
      parameterTypes - The types of the method parameters
      returnType - The method return type
      filename - The source file where this pointer is created
      lineNumber - The line number in the source file where this pointer is created
      Returns:
      A lambda that invokes the interface method
    • makeJavaStaticMethodPtr

      public static Expression makeJavaStaticMethodPtr(String className, String methodName, Type[] parameterTypes, Type returnType)
      Create a pointer to a static Java method
      Parameters:
      className - The name of the Java class containing the method
      methodName - The name of the method to point to
      parameterTypes - The types of the method parameters
      returnType - The method return type
      Returns:
      A lambda that invokes the interface method
    • makeJavaStaticMethodPtr

      public static Expression makeJavaStaticMethodPtr(String className, String methodName, Type[] parameterTypes, Type returnType, String filename, int lineNumber)
      Create a pointer to a static Java method
      Parameters:
      className - The name of the Java class containing the method
      methodName - The name of the method to point to
      parameterTypes - The types of the method parameters
      returnType - The method return type
      filename - The source file where this pointer is created
      lineNumber - The line number in the source file where this pointer is created
      Returns:
      A lambda that invokes the interface method
    • makeMethodPtr

      public static Expression makeMethodPtr(String className, String methodName, Type[] parameterTypes, Type returnType, Expression target)
      Create a pointer to a method that may or may not do tail call optimization
      Parameters:
      className - The name of the class containing the method
      methodName - The name of the method to point to
      parameterTypes - The types of the method parameters
      returnType - The method return type
      target - The object this method should be invoked on
      Returns:
      A lambda that invokes the interface method
    • makeMethodPtr

      public static Expression makeMethodPtr(String className, String methodName, Type[] parameterTypes, Type returnType, Expression target, String filename, int lineNumber)
      Create a pointer to a method that may or may not do tail call optimization
      Parameters:
      className - The name of the class containing the method
      methodName - The name of the method to point to
      parameterTypes - The types of the method parameters
      returnType - The method return type
      target - The object this method should be invoked on
      filename - The source file where this pointer is created
      lineNumber - The line number in the source file where this pointer is created
      Returns:
      A lambda that invokes the interface method
    • makeMethodPtr

      public static Expression makeMethodPtr(String className, String methodName, Type[] parameterTypes, Type returnType)
      Create a pointer to a method that may or may not do tail call optimization and requires the object to be passed in when invoked
      Parameters:
      className - The name of the class containing the method
      methodName - The name of the method to point to
      parameterTypes - The types of the method parameters
      returnType - The method return type
      Returns:
      A lambda that invokes the interface method
    • makeMethodPtr

      public static Expression makeMethodPtr(String className, String methodName, Type[] parameterTypes, Type returnType, String filename, int lineNumber)
      Create a pointer to a method that may or may not do tail call optimization and requires the object to be passed in when invoked
      Parameters:
      className - The name of the class containing the method
      methodName - The name of the method to point to
      parameterTypes - The types of the method parameters
      returnType - The method return type
      filename - The source file where this pointer is created
      lineNumber - The line number in the source file where this pointer is created
      Returns:
      A lambda that invokes the interface method
    • makeStaticMethodPtr

      public static Expression makeStaticMethodPtr(String className, String methodName, Type[] parameterTypes, Type returnType)
      Create a pointer to a static method that may or may not do tail call optimization
      Parameters:
      className - The name of the class containing the method
      methodName - The name of the method to point to
      parameterTypes - The types of the method parameters
      returnType - The method return type
      Returns:
      A lambda that invokes the interface method
    • makeStaticMethodPtr

      public static Expression makeStaticMethodPtr(String className, String methodName, Type[] parameterTypes, Type returnType, String filename, int lineNumber)
      Create a pointer to a static method that may or may not do tail call optimization
      Parameters:
      className - The name of the class containing the method
      methodName - The name of the method to point to
      parameterTypes - The types of the method parameters
      returnType - The method return type
      filename - The source file where this pointer is created
      lineNumber - The line number in the source file where this pointer is created
      Returns:
      A lambda that invokes the interface method
    • makeTailCallMethodPtr

      public static Expression makeTailCallMethodPtr(String className, String methodName, Type[] parameterTypes, Type returnType, Expression target)
      Create a pointer to a method that uses tail call optimization
      Parameters:
      className - The name of the class containing the method
      methodName - The name of the method to point to
      parameterTypes - The types of the method parameters
      returnType - The method return type
      target - The object this method should be invoked on
      Returns:
      A lambda that invokes the interface method
    • makeTailCallMethodPtr

      public static Expression makeTailCallMethodPtr(String className, String methodName, Type[] parameterTypes, Type returnType, Expression target, String filename, int lineNumber)
      Create a pointer to a method that uses tail call optimization
      Parameters:
      className - The name of the class containing the method
      methodName - The name of the method to point to
      parameterTypes - The types of the method parameters
      returnType - The method return type
      target - The object this method should be invoked on
      filename - The source file where this pointer is created
      lineNumber - The line number in the source file where this pointer is created
      Returns:
      A lambda that invokes the interface method
    • makeTailCallMethodPtr

      public static Expression makeTailCallMethodPtr(String className, String methodName, Type[] parameterTypes, Type returnType)
      Create a pointer to a method that uses tail call optimization
      Parameters:
      className - The name of the class containing the method
      methodName - The name of the method to point to
      parameterTypes - The types of the method parameters
      returnType - The method return type
      Returns:
      A lambda that invokes the interface method
    • makeTailCallMethodPtr

      public static Expression makeTailCallMethodPtr(String className, String methodName, Type[] parameterTypes, Type returnType, String filename, int lineNumber)
      Create a pointer to a method that uses tail call optimization
      Parameters:
      className - The name of the class containing the method
      methodName - The name of the method to point to
      parameterTypes - The types of the method parameters
      returnType - The method return type
      filename - The source file where this pointer is created
      lineNumber - The line number in the source file where this pointer is created
      Returns:
      A lambda that invokes the interface method
    • makeTailCallStaticMethodPtr

      public static Expression makeTailCallStaticMethodPtr(String className, String methodName, Type[] parameterTypes, Type returnType)
      Create a pointer to a static method that uses tail call optimization
      Parameters:
      className - The name of the class containing the method
      methodName - The name of the method to point to
      parameterTypes - The types of the method parameters
      returnType - The method return type
      Returns:
      A lambda that invokes the interface method
    • makeTailCallStaticMethodPtr

      public static Expression makeTailCallStaticMethodPtr(String className, String methodName, Type[] parameterTypes, Type returnType, String filename, int lineNumber)
      Create a pointer to a static method that uses tail call optimization
      Parameters:
      className - The name of the class containing the method
      methodName - The name of the method to point to
      parameterTypes - The types of the method parameters
      returnType - The method return type
      filename - The source file where this pointer is created
      lineNumber - The line number in the source file where this pointer is created
      Returns:
      A lambda that invokes the interface method