public class TMReceiver extends AbstractReceiver
TMDirector| Yellow (janneck) |
| Yellow (liuj) |
| Constructor and Description |
|---|
TMReceiver()
Construct an empty TMReceiver with no container.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
_triggerEvent(Token token)
Make a token available to the get() method.
|
void |
clear()
Clear this receiver of any contained tokens.
|
java.util.List<Token> |
elementList()
Return a list with the tokens currently in the receiver, or
an empty list if there are no such tokens.
|
Token |
get()
Get a token from the receiver.
|
TMDirector |
getDirector()
Return the director that created this receiver.
|
boolean |
hasRoom()
Return true, indicating that there is always room.
|
boolean |
hasRoom(int tokens)
Return true, indicating that there is always room for any number
of tokens.
|
boolean |
hasToken()
Return true if there is at least one token available to the
get() method.
|
boolean |
hasToken(int numberOfTokens)
Return true if there are numberOfTokens
tokens available to the get() method.
|
void |
put(Token token)
Put a token into this receiver.
|
getArray, getContainer, getCurrentTime, getModelTime, isKnown, putArray, putArrayToAll, putToAll, reset, setContainer, toStringpublic void clear()
clear in interface Receiverclear in class AbstractReceiverpublic java.util.List<Token> elementList()
elementList in interface ReceiverelementList in class AbstractReceiverpublic Token get() throws NoTokenException
get in interface Receiverget in class AbstractReceiverNoTokenException - Not thrown in this base class.public TMDirector getDirector() throws IllegalActionException
IllegalActionException - If there is no container port, or
if the port has no container actor, or if the actor has no director,
or if the director is not an instance of TMDirector.public final boolean hasRoom()
hasRoom in interface ReceiverhasRoom in class AbstractReceiverpublic final boolean hasRoom(int tokens)
hasRoom in interface ReceiverhasRoom in class AbstractReceivertokens - The number of tokens, currently ignored.public final boolean hasToken()
hasToken in interface ReceiverhasToken in class AbstractReceiverpublic final boolean hasToken(int numberOfTokens)
hasToken in interface ReceiverhasToken in class AbstractReceivernumberOfTokens - The number of tokens, currently ignored.public void put(Token token)
put in interface Receiverput in class AbstractReceivertoken - The token to be put, or null to put no token.protected void _triggerEvent(Token token)
token - The token to make available to get().