|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.actor.AbstractReceiver
ptolemy.domains.tm.kernel.TMReceiver
public class TMReceiver
The receiver for the TM domain. This receiver contains a FIFO queue. Upon receiving a token, it creates a TMEvent. The properties of the TM events are:
TMDirector
Yellow (janneck) |
Yellow (liuj) |
Field Summary | |
---|---|
private TMDirector |
_director
|
private long |
_directorVersion
|
private java.util.LinkedList |
_tokens
|
Constructor Summary | |
---|---|
TMReceiver()
Construct an empty TMReceiver with no container. |
Method Summary | |
---|---|
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. |
Methods inherited from class ptolemy.actor.AbstractReceiver |
---|
getArray, getContainer, getCurrentTime, getModelTime, isKnown, putArray, putArrayToAll, putToAll, reset, setContainer, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private TMDirector _director
private long _directorVersion
private java.util.LinkedList _tokens
Constructor Detail |
---|
public TMReceiver()
Method Detail |
---|
public void clear()
clear
in interface Receiver
clear
in class AbstractReceiver
public java.util.List<Token> elementList()
elementList
in interface Receiver
elementList
in class AbstractReceiver
public Token get() throws NoTokenException
get
in interface Receiver
get
in class AbstractReceiver
NoTokenException
- 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 Receiver
hasRoom
in class AbstractReceiver
public final boolean hasRoom(int tokens)
hasRoom
in interface Receiver
hasRoom
in class AbstractReceiver
tokens
- The number of tokens, currently ignored.
public final boolean hasToken()
hasToken
in interface Receiver
hasToken
in class AbstractReceiver
public final boolean hasToken(int numberOfTokens)
hasToken
in interface Receiver
hasToken
in class AbstractReceiver
numberOfTokens
- The number of tokens, currently ignored.
public void put(Token token)
put
in interface Receiver
put
in class AbstractReceiver
token
- The token to be put, or null to put no token.protected void _triggerEvent(Token token)
token
- The token to make available to get().
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |