public class JavaScript.PortOrParameterProxy
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.List<Token> |
_localInputTokens
A list of tokens that this JavaScript actor has sent to its own input.
|
protected Variable |
_parameter
The parameter that is proxied, or null if it's a port.
|
protected TypedIOPort |
_port
The port that is proxied, or null if it's a parameter.
|
Modifier | Constructor and Description |
---|---|
protected |
PortOrParameterProxy(NamedObj portOrParameter)
Construct a proxy.
|
Modifier and Type | Method and Description |
---|---|
Token |
get(int channelIndex)
Get the current value of the input port or a parameter.
|
boolean |
isJSON()
Return true if the port or parameter value is required to be JSON.
|
void |
send(int channelIndex,
Token data,
java.lang.Object value)
Expose the send() method of the port.
|
void |
set(Token token)
Set the current value of the parameter.
|
java.lang.String |
toString()
Return the name of the proxied port or parameter.
|
protected java.util.List<Token> _localInputTokens
protected Variable _parameter
protected TypedIOPort _port
protected PortOrParameterProxy(NamedObj portOrParameter) throws IllegalActionException
portOrParameter
- The object to be proxied.IllegalActionException
- If the argument is neither a port nor a parameter.public boolean isJSON()
public Token get(int channelIndex) throws IllegalActionException
channelIndex
- The channel index. This is ignored for parameters.IllegalActionException
- If the port is not an input port
or retrieving the value fails.public void send(int channelIndex, Token data, java.lang.Object value) throws NoRoomException, IllegalActionException
channelIndex
- The channel index.data
- The token to send.value
- The JavaScript value to pass back when the send actually occurs.IllegalActionException
- If this is a proxy for a parameter or if sending fails.NoRoomException
- If there is no room at the destination.public void set(Token token) throws IllegalActionException
token
- The value of the parameter.IllegalActionException
- If the set fails or if this is a proxy for a port.public java.lang.String toString()
toString
in class java.lang.Object