Interface HostFunBuilder


public interface HostFunBuilder
An immutable buildre of host funs.
  • Method Summary

    Modifier and Type
    Method
    Description
    Makes a fun.
    desc(String desc)
    Returns a new builder with the specified desc, and all the other properties inherited from this.
    take(int numArgs)
    Returns a new builder with the specified number of args.
    takeMin(int argsMin)
    Returns a new builder with the specified minimum number of args.
    takeMinMax(int argsMin, int argsMax)
    Returns a builder with the specified minimum and the maximum number of args.
  • Method Details

    • desc

      HostFunBuilder desc(String desc)
      Returns a new builder with the specified desc, and all the other properties inherited from this.
      Parameters:
      desc - the desc of the fun.
      Returns:
      a new builder.
    • take

      HostFunBuilder take(int numArgs)
      Returns a new builder with the specified number of args.

      The number of args passed to a fun built by the result builder must be equal to numArgs.

      Precondition: numArgs must be nonnegative.

      Parameters:
      numArgs - the number of args which the fun takes.
      Returns:
      a new builder.
    • takeMin

      HostFunBuilder takeMin(int argsMin)
      Returns a new builder with the specified minimum number of args.

      The number of args passed to a fun built by the result builder must be greater than or equal to argsMin.

      Precondition: argsMin must be nonnegative.

      Parameters:
      argsMin - the minimum number of args which the fun takes.
      Returns:
      a new builder.
    • takeMinMax

      HostFunBuilder takeMinMax(int argsMin, int argsMax)
      Returns a builder with the specified minimum and the maximum number of args.

      The number of args passed to a fun built by the result builder must be in the range [argsMin, argsMax].

      Precondition:

      • argsMin must be nonnegative
      • argsMin must be less than or equal to argsMax
      Parameters:
      argsMin - the minimum number of args which the fun takes.
      argsMax - the maximum number of args which the fun takes.
      Returns:
      a new builder.
    • action

      FunVal action(HostFunAction action)
      Makes a fun.
      Parameters:
      action - action which is called after args checking passes.
      Returns:
      a fun.