Class BranchTask

  • All Implemented Interfaces:
    TreeTask

    public abstract class BranchTask
    extends java.lang.Object
    implements TreeTask
    • Constructor Detail

      • BranchTask

        public BranchTask​(APIContext ctx)
    • Method Detail

      • createSuccessTask

        protected abstract TreeTask createSuccessTask​(APIContext ctx)
        The success task that will be executed when validate() is true.
        Parameters:
        ctx - APIContext
        Returns:
        the success task
      • createFailureTask

        protected abstract TreeTask createFailureTask​(APIContext ctx)
        The failure task that will be executed when validate() is false.
        Parameters:
        ctx - APIContext
        Returns:
        the failure task
      • validate

        public abstract boolean validate()
        Returns the condition of this branch.
        Returns:
        boolean
      • execute

        public final void execute()
        Description copied from interface: TreeTask
        Execute this task.
        Specified by:
        execute in interface TreeTask