package com.poco.PoCoRuntime;

import java.util.ArrayList;

/**
 * Base class that both sequential and alternating executions inherit from. Defines functionality
 * that any execution should have.
 */
public abstract class AbstractExecution extends EventResponder implements Matchable, Queryable {
    protected boolean isZeroPlus, isOnePlus;
    protected ArrayList<EventResponder> children = new ArrayList<>();

    public AbstractExecution(String modifier) throws PoCoException {
        interpretModifier(modifier);
    }

    public AbstractExecution() throws PoCoException {
        interpretModifier("none");
    }

    private void interpretModifier(String modifier) throws PoCoException {
        switch (modifier) {
            case "none":
                isZeroPlus = isOnePlus = false;
                break;
            case "*":
                isZeroPlus = true;
                isOnePlus = false;
                break;
            case "+":
                isZeroPlus = false;
                isOnePlus = true;
                break;
            default:
                throw new PoCoException("Incorrect execution modifier " + modifier);
        }
    }

    public void addChild(EventResponder child) {
        children.add(child);
    }
}

@@ -1251,11 +1251,96 @@
 );%0A    %7D
+%0A%0A    public ArrayList%3CEventResponder%3E getChildren() %7B%0A        return children;%0A    %7D
 %0A%7D%0A

Add getChildren fun