public class TestAbstractReceiver extends AbstractReceiver
| Constructor and Description |
|---|
TestAbstractReceiver(IOPort container)
Construct an empty receiver with the specified container.
|
| Modifier and Type | Method and Description |
|---|---|
Token |
get()
Get a token from this receiver.
|
boolean |
hasRoom()
Return true if the receiver has room to put a token into it
(via the put() method).
|
boolean |
hasRoom(int numberOfTokens)
Return true if the receiver has room to put the specified number of
tokens into it (via the put() method).
|
boolean |
hasToken()
Return true if the receiver contains a token that can be obtained
by calling the get() method.
|
boolean |
hasToken(int numberOfTokens)
Return true if the receiver contains the specified number of tokens.
|
boolean |
isKnown()
Return true.
|
void |
put(Token token)
Put the specified token into this receiver.
|
clear, elementList, getArray, getContainer, getCurrentTime, getModelTime, putArray, putArrayToAll, putToAll, reset, setContainer, toStringpublic TestAbstractReceiver(IOPort container) throws IllegalActionException
container - The container of the receiver.IllegalActionException - If the container does
not accept this receiver.public Token get() throws NoTokenException
get in interface Receiverget in class AbstractReceiverNoTokenException - If there is no token.public boolean hasRoom()
hasRoom in interface ReceiverhasRoom in class AbstractReceiverpublic boolean hasRoom(int numberOfTokens)
hasRoom in interface ReceiverhasRoom in class AbstractReceivernumberOfTokens - The number of tokens to put into this receiver.public boolean hasToken()
hasToken in interface ReceiverhasToken in class AbstractReceiverpublic boolean hasToken(int numberOfTokens)
hasToken in interface ReceiverhasToken in class AbstractReceivernumberOfTokens - The number of tokens desired.public boolean isKnown()
isKnown in interface ReceiverisKnown in class AbstractReceiverpublic void put(Token token) throws NoRoomException, IllegalActionException
put in interface Receiverput in class AbstractReceivertoken - The token to put into the receiver.NoRoomException - If there is no room in the receiver.IllegalActionException - If the put fails
(e.g. because of incompatible types).