if (modified == null) {
modified = new TypedIOPort(this, "modified", false,
true);
modified.setTypeEquals(BaseType.BOOLEAN);
modified.setPersistent(false);
new StringAttribute(modified, "_cardinal")
.setExpression("SOUTH");
}
} catch (KernelException e) {
throw new InternalErrorException(this, e,
"Cannot remove port.");
}
} else if (modeString.equals(Mode.EXPERT.toString())) {
try {
boolean repeat = ((BooleanToken) repeatUntilFixpoint
.getToken()).booleanValue();
if (repeat) {
// Repeat is not supported in EXPERT mode, so do not
// modify the ports; otherwise, the links to the
// original ports will be lost after cancellation.
return;
}
} catch (IllegalActionException e) {
throw new InternalErrorException(e);
}
try {
if (modified != null) {
modified.setContainer(null);
modified = null;
}
if (matchInput == null) {
matchInput = new TypedIOPort(this, "matchInput", true,
false);
matchInput.setTypeEquals(BaseType.OBJECT);
matchInput.setPersistent(false);
}
if (matchOutput == null) {
matchOutput = new TypedIOPort(this, "matchOutput",
false, true);
matchOutput.setTypeEquals(BaseType.OBJECT);
matchOutput.setPersistent(false);
}
if (trigger == null) {
trigger = new TypedIOPort(this, "trigger", true, false);
trigger.setTypeEquals(BaseType.BOOLEAN);
trigger.setPersistent(false);
new StringAttribute(trigger, "_cardinal")
.setExpression("SOUTH");
}
if (remaining == null) {
remaining = new TypedIOPort(this, "remaining", false,
true);
remaining.setTypeEquals(BaseType.INT);
remaining.setPersistent(false);
new StringAttribute(remaining, "_cardinal")
.setExpression("SOUTH");
}
} catch (KernelException e) {
throw new InternalErrorException(this, e,
"Cannot create port.");