public class CommunicationToken extends Token
Note: Kahn process networks are not being handled right now.
Constructor and Description |
---|
CommunicationToken()
Create a new instance with targetActor set to null.
|
CommunicationToken(java.lang.String targetActor)
Create a new instance and set the name of the targetActor.
|
Modifier and Type | Method and Description |
---|---|
void |
addPort(java.lang.String port,
int width)
Add the port with the specified number of channels.
|
boolean |
equals(java.lang.Object object)
Return true if the object is equal to the instance, false otherwise.
|
java.util.HashMap<java.lang.String,java.util.ArrayList<Token[]>> |
getPortChannelTokenMap()
Return the mapping from ports to their channels with tokens have been received within one iteration.
|
int |
getSize()
Return number of original tokens contained within the Communication Token.
|
java.lang.String |
getTargetActorName()
Return the full name of the target actor that received the tokens encapsulated by the
CommunicationToken.
|
Token[] |
getTokens(java.lang.String port,
int channel)
Return the tokens of a specific port and channel.
|
int |
hashCode()
Compute hash code of the instance based on the targetActorname and portChannelTokenMap.
|
void |
putTokens(java.lang.String port,
int channel,
Token[] tokens)
Put tokens received from the port and channel into the CommunicationToken.
|
void |
setTargetActorName(java.lang.String targetActorName)
Set the full name of the targetActor that received the tokens that the
CommunicationToken encapsulates.
|
add, addReverse, divide, divideReverse, getType, isCloseTo, isCloseTo, isEqualTo, isNil, modulo, moduloReverse, multiply, multiplyReverse, notSupportedConversionMessage, notSupportedIncomparableConversionMessage, notSupportedIncomparableMessage, notSupportedMessage, notSupportedNullNilStringMessage, one, pow, subtract, subtractReverse, toString, zero, zeroReturnType
public CommunicationToken()
public CommunicationToken(java.lang.String targetActor)
targetActor
- the target actor whose tokens this instance encapsulates.public void addPort(java.lang.String port, int width)
port
- The port name as it's returned by NamedObj.getName() method.width
- The number of channel that the port has.public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
object
- The reference object with which to compare.Object.equals(java.lang.Object)
public java.util.HashMap<java.lang.String,java.util.ArrayList<Token[]>> getPortChannelTokenMap()
public int getSize()
public java.lang.String getTargetActorName()
setTargetActorName(String)
public Token[] getTokens(java.lang.String port, int channel)
port
- Port of the targetActorchannel
- Port's channel of the targetActorpublic int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public void putTokens(java.lang.String port, int channel, Token[] tokens)
port
- port of the targetActorchannel
- channel of the porttokens
- Array of tokens received from the channel within one iterationpublic void setTargetActorName(java.lang.String targetActorName)
targetActorName
- the name of the target actorgetTargetActorName()