|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectptolemy.actor.AbstractReceiver
ptolemy.actor.Mailbox
ptolemy.domains.ct.kernel.CTReceiver
The receiver for the continuous time (mixed-signal) domain. The receiver can be of one of the two types: CONTINUOUS and DISCRETE. Conceptually, a CONTINUOUS CTReceiver contains a sample of a continuous signal at a particular time (defined by the CTDirector). Thus, there is one and only one token at all time in a CONTINUOUS CTReceiver. A DISCRETE CTReceiver contains a discrete event. Thus a DISCRETE CTReceiver may be empty if an event is not present.
The receiver is implemented as a Mailbox of capacity one. Any token put in the receiver overwrites any token previously present in the receiver. As a consequence, hasRoom() method always returns true.
The behavior of the get() method depends on the type of the receiver. If it is CONTINUOUS, then get() only reads the value. Consecutive get() will return the same token if no put() has been called. For a CONTINUOUS CTReceiver, hasToken() will always return true after the first put() has been called. For a DISCRETE CTReceiver, get() will return and destroy the token, thus the token can only be processed once. After the consumption, the hasToken() method will return false, until a token is put into this receiver.
| Green (yuhong) |
| Green (liuj) |
| Nested Class Summary | |
static class |
CTReceiver.SignalType
Inner class used for the static enumeration of indicators of signal types. |
| Field Summary | |
static CTReceiver.SignalType |
CONTINUOUS
Signal type: continuous |
static CTReceiver.SignalType |
DISCRETE
Signal type: discrete |
static CTReceiver.SignalType |
UNKNOWN
Signal type: unknown |
| Fields inherited from class ptolemy.actor.Mailbox |
_token |
| Constructor Summary | |
CTReceiver()
Construct an empty CTReceiver with no container. |
|
CTReceiver(IOPort container)
Construct an empty CTReceiver with the specified container. |
|
| Method Summary | |
Token |
get()
Return the contained token if it is not null. |
CTReceiver.SignalType |
getSignalType()
Return the signal type of this receiver. |
boolean |
hasRoom()
Return true, since the new token will override the old one. |
void |
put(Token token)
Put a token into this receiver. |
void |
setSignalType(CTReceiver.SignalType type)
Set the signal type of this receiver. |
| Methods inherited from class ptolemy.actor.Mailbox |
clear, hasRoom, hasToken, hasToken |
| 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 |
| Field Detail |
public static CTReceiver.SignalType CONTINUOUS
public static CTReceiver.SignalType DISCRETE
public static CTReceiver.SignalType UNKNOWN
| Constructor Detail |
public CTReceiver()
public CTReceiver(IOPort container)
throws IllegalActionException
container - The port that contains the receiver.
IllegalActionException - If this receiver cannot be
contained by the proposed container.| Method Detail |
public Token get()
throws NoTokenException
get in interface Receiverget in class MailboxNoTokenException - If the receiver contains null.
InvalidStateException - If this method is called and
the signal type of this receiver is UNKNOWN.public CTReceiver.SignalType getSignalType()
public boolean hasRoom()
hasRoom in interface ReceiverhasRoom in class Mailbox
public void put(Token token)
throws NoRoomException
put in interface Receiverput in class Mailboxtoken - The token to be put into this receiver.
NoRoomException - Not thrown in this base class.public void setSignalType(CTReceiver.SignalType type)
type - The SignalType to set to the receiver.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||