Class FunctionalEnvironmentRoutine

All Implemented Interfaces:
Attribute, EnvironmentAttribute

public class FunctionalEnvironmentRoutine extends EnvironmentRoutine
Class for representing an environment routine whose behaviour is defined via a functional interface.

This class is useful for defining simple routine logic without requiring full subclassing, particularly when integrating with languages like Python.

  • Constructor Details

    • FunctionalEnvironmentRoutine

      public FunctionalEnvironmentRoutine(String name, AttributeAccessLevel accessLevel, EnvironmentRoutineRunFunction runLogic)
      Constructs a new functional environment routine with the specified behaviour function.
      Parameters:
      name - the name of the routine, used to identify it within its attribute set
      accessLevel - the access level of the routine, determining whether other entities may read it
      runLogic - the function defining the routine's behaviour
  • Method Details

    • run

      protected void run(EnvironmentContext context)
      Runs this routine's behaviour by applying the user-provided run function.
      Specified by:
      run in class Routine<EnvironmentContext>
      Parameters:
      context - the context the routine can use in its behaviour