package com.poco.PoCoRuntime;

/**
 * Represents an exchange from a PoCo policy.
 */
public class Exchange extends EventResponder implements Matchable, Queryable {
    private Matchable matcher;
    private SRE returnSRE;

    public Exchange() {
        // Initialize...
    }

    public void addMatcher(Matchable matcher) {
        this.matcher = matcher;
    }

    public void setSRE(SRE sre) {
        this.returnSRE = sre;
    }

    @Override
    public boolean accepts(Event event) {
        return matcher.accepts(event);
    }

    @Override
    public SRE query(Event event) {
        if (this.accepts(event)) {
            return returnSRE;
        }
        return null;
    }
}

@@ -684,10 +684,164 @@
 ;%0A    %7D%0A
+    %0A    @Override%0A    public String toString() %7B%0A        return %22Exchange %5Bmatcher=%22 + matcher + %22, returnSRE=%22 + returnSRE%0A                + %22%5D%22;%0A    %7D%0A
 %7D%0A

add toString()