|
|||||||||
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.ci.kernel.CIReceiver
public class CIReceiver
An implementation of the ptolemy.actor.Receiver interface for the CI domain. This receiver provides a FIFO buffer between an active actor and an inactive actor or two inactive actors. When an active actor with push output puts a token in a receiver, the inactive actor that reads from the receiver will be put in the task queue of the director. When the director fires an inactive actor, the actors that receive data from this actor are executed as data-driven. For an active actor with pull input, its actor manager will be notified when an input token arrives, and will continue to iterate the actor.
Red (liuxj) |
Yellow (liuxj) |
Field Summary | |
---|---|
private Actor |
_actor
|
private CIDirector |
_director
|
private boolean |
_initialized
|
private boolean |
_isAsyncPullSink
|
private boolean |
_isAsyncPushSink
|
private boolean |
_isPush
|
private java.util.LinkedList<Token> |
_tokens
|
Constructor Summary | |
---|---|
CIReceiver(CIDirector director)
Construct an empty receiver. |
Method Summary | |
---|---|
private void |
_initialize()
|
private void |
_notify()
|
void |
clear()
Clear this receiver. |
Token |
get()
Get a token from this receiver. |
boolean |
hasRoom()
Return true. |
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. |
void |
put(Token token)
Put the specified token into this receiver. |
void |
putArray(Token[] tokenArray,
int numberOfTokens)
Put a portion of the specified token array into this receiver. |
Methods inherited from class ptolemy.actor.AbstractReceiver |
---|
elementList, getArray, getContainer, getCurrentTime, getModelTime, isKnown, 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 CIDirector _director
private Actor _actor
private java.util.LinkedList<Token> _tokens
private boolean _initialized
private boolean _isAsyncPushSink
private boolean _isAsyncPullSink
private boolean _isPush
Constructor Detail |
---|
public CIReceiver(CIDirector director)
director
- The director that creates this receiver.Method Detail |
---|
public void clear()
clear
in interface Receiver
clear
in class AbstractReceiver
public Token get() throws NoTokenException
get
in interface Receiver
get
in class AbstractReceiver
NoTokenException
- If there is no token.public boolean hasRoom()
hasRoom
in interface Receiver
hasRoom
in class AbstractReceiver
public boolean hasRoom(int numberOfTokens)
hasRoom
in interface Receiver
hasRoom
in class AbstractReceiver
numberOfTokens
- The number of tokens to put into this receiver.
public boolean hasToken()
hasToken
in interface Receiver
hasToken
in class AbstractReceiver
public boolean hasToken(int numberOfTokens)
hasToken
in interface Receiver
hasToken
in class AbstractReceiver
numberOfTokens
- The number of tokens desired.
public void put(Token token) throws NoRoomException
put
in interface Receiver
put
in class AbstractReceiver
token
- The token to put into the receiver, or null to put no token.
NoRoomException
- If there is no room in the receiver.public void putArray(Token[] tokenArray, int numberOfTokens) throws NoRoomException
putArray
in interface Receiver
putArray
in class AbstractReceiver
tokenArray
- The array containing tokens to put into this
receiver.numberOfTokens
- The number of elements of the token
array to put into this receiver.
NoRoomException
- If the token array cannot be put.private void _initialize() throws IllegalActionException
IllegalActionException
private void _notify()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |