Class AbstractDefinedFunctor

All Implemented Interfaces:
DefinedFunctor, Functor, TypedFunctor
Direct Known Subclasses:
Action, Function0, Function1, Function2, Function3, Function4, Function5, Function6, Function7, Function8, Function9, Predicate, ProxyHandler

public abstract class AbstractDefinedFunctor extends AbstractTypedFunctor implements DefinedFunctor
This class provides a partial implementation of the DefinedFunctor interface.
Author:
Mackenzie High
  • Constructor Details

    • AbstractDefinedFunctor

      public AbstractDefinedFunctor(TypedFunctor inner)
      Sole Constructor.
      Parameters:
      inner - is the inner() functor.
  • Method Details

    • inner

      public final TypedFunctor inner()
      This method retrieves the functor that is wrapped by this object.
      Specified by:
      inner in interface DefinedFunctor
      Returns:
      the inner functor.
    • apply

      public final void apply(ArgumentStack stack) throws Throwable
      This method performs an invocation of this function object.

      Programmers should not call this method directly. Instead, for convenience, call this method indirectly via (F::apply List).

      Calling Convention from top to bottom (n >= 0):

      1. argument[n]
      2. argument[.]
      3. argument[2]
      4. argument[1]
      5. argument[0]

      The argument stack will be cleared and then the result will be pushed onto it. If the functor does not return a value, then the stack will remain empty.

      Specified by:
      apply in interface DefinedFunctor
      Specified by:
      apply in interface Functor
      Parameters:
      stack - is a stack containing the arguments being passed to this functor.
      Throws:
      Throwable - in order to propagate exceptions thrown by the functor.
    • toString

      public final String toString()
      Overrides:
      toString in class Object