01: package org.obe.xpdl.model.ext;
02:
03: import org.obe.xpdl.PackageVisitor;
04: import org.obe.xpdl.model.XPDLProperties;
05: import org.obe.xpdl.model.misc.Invocation;
06:
07: /**
08: * @author Adrian Price
09: */
10: public abstract class Trigger extends Invocation {
11: public static final String COUNT = XPDLProperties.COUNT;
12:
13: protected int _count;
14:
15: protected Trigger() {
16: _count = -1;
17: }
18:
19: protected Trigger(String id, String count) {
20: super (id);
21: setCount(count == null ? -1 : Integer.parseInt(count));
22: }
23:
24: public final int getCount() {
25: return _count;
26: }
27:
28: public final void setCount(int count) {
29: if (count < -1 || count == 0)
30: throw new IllegalArgumentException("illegal count value: "
31: + count);
32: _count = count;
33: }
34:
35: public final void accept(PackageVisitor visitor) {
36: visitor.visit(this);
37: super.accept(visitor);
38: }
39: }
|