Send the token in the value parameter to the output. @exception IllegalActionException If it is thrown by the send() method sending out the token.
()
| 134 | */ |
| 135 | |
| 136 | public void fire() throws IllegalActionException { |
| 137 | super.fire(); |
| 138 | |
| 139 | // If the parameterValue input port is connected and has data, then |
| 140 | // get the parameter value from there |
| 141 | if (parameterValuePort.getWidth() > 0) { |
| 142 | if (parameterValuePort.hasToken(0)) { |
| 143 | String name = ((StringToken) parameterValuePort.get(0)) |
| 144 | .stringValue(); |
| 145 | |
| 146 | // Using setExpression() rather than setToken() allows |
| 147 | // the string to refer to variables defined in the |
| 148 | // scope of this actor. |
| 149 | parameterValue.setExpression(name); |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | String parameterNameStr = parameterName.getToken().toString(); |
| 154 | parameterNameStr = parameterNameStr.substring(1, parameterNameStr.length() - 1); |
| 155 | String parameterValueStr = parameterValue.getToken().toString(); |
| 156 | parameterValueStr = parameterValueStr.substring(1, parameterValueStr.length() - 1); |
| 157 | |
| 158 | output.send(0, new StringToken(parameterNameStr + " " + parameterValueStr)); |
| 159 | } |
| 160 | } |
nothing calls this directly
no test coverage detected