|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectptolemy.actor.AbstractReceiver
ptolemy.domains.de.kernel.DEReceiver
ptolemy.domains.hde.kernel.HDEReceiver
An implementation of the ptolemy.actor.Receiver interface for the DE domain. Tokens that are put into this receiver logically have time stamps. If the time stamp is not explicitly given using the setDelay() method, then it is assumed to be the current time (which is maintained by the director). The put() method sends the specified token to the director, which returns it to this receiver (via the protected method _triggerEvent()) when current time matches the time stamp of the token. The get() method returns only tokens that the director has so returned. Thus, when a token is put into the receiver using put(), it does not become immediately available to the get() method.
By default, the time stamp of a token is the current time of the director when put() is called. To specify a time stamp in the future, call setDelay() prior to calling put(). This should be done in a synchronized manner, since there could be multiple thread running in this domain.
Before firing an actor, the director is expected to put at least one token into at least one of the receivers contained by the actor.
| Green (cxh) |
| Green (liuj) |
| Constructor Summary | |
HDEReceiver()
Construct an empty DEReceiver with no container. |
|
HDEReceiver(IOPort container)
Construct an empty HDEReceiver with the specified container. |
|
| Method Summary | |
protected void |
_triggerEvent(Token token)
Make a token available to the get() method. |
Token |
get()
Get a token from the receiver. |
boolean |
hasToken()
Return true if there are tokens available to the get() method. |
boolean |
hasToken(int numberOfTokens)
Return true if there are numberOfTokens tokens tokens available to the get() method. |
| Methods inherited from class ptolemy.domains.de.kernel.DEReceiver |
clear, getDirector, hasRoom, hasRoom, put, put, setDelay |
| Methods inherited from class ptolemy.actor.AbstractReceiver |
getArray, getContainer, getCurrentTime, isKnown, putArray, setContainer |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public HDEReceiver()
public HDEReceiver(IOPort container)
throws IllegalActionException
container - The container.
IllegalActionException - If the container does
not accept this receiver.| Method Detail |
public Token get()
get in interface Receiverget in class DEReceiverNoTokenException - If there are no more tokens. This is
a runtime exception, so it need not be declared explicitly.public final boolean hasToken()
hasToken in interface ReceiverhasToken in class DEReceiverpublic final boolean hasToken(int numberOfTokens)
hasToken in interface ReceiverhasToken in class DEReceiverprotected void _triggerEvent(Token token)
_triggerEvent in class DEReceivertoken - The token to make available to get().
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||