Package ptolemy.domains.sysml.kernel
Class SysMLConcurrentDirector.SysMLAReceiver
- java.lang.Object
-
- ptolemy.actor.AbstractReceiver
-
- ptolemy.actor.Mailbox
-
- ptolemy.domains.sysml.kernel.SysMLConcurrentDirector.SysMLAReceiver
-
- All Implemented Interfaces:
Receiver
- Enclosing class:
- SysMLConcurrentDirector
public class SysMLConcurrentDirector.SysMLAReceiver extends Mailbox
Variant of a Mailbox that overrides the put() method to divert the input to the queue associated with the actor and then provides a method to really put a token into a receiver. If the containing port has a boolean-valued attribute named "flow", then the behavior is quite different. First, a put updates the value of the receiver immediately in addition to putting a "change event" on the event queue. Second, the receiver value is persistent. A get() does not clear the receiver.
-
-
Constructor Summary
Constructors Constructor Description SysMLAReceiver()
Construct a SysMLAReceiver.SysMLAReceiver(IOPort container)
Construct a SysMLAReceiver.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Token
get()
Get the contained Token.void
put(Token token)
Put a token into the queue for containing actor.void
reallyPut(Token token)
Put a token into the mailbox.-
Methods inherited from class ptolemy.actor.Mailbox
clear, elementList, hasRoom, hasRoom, hasToken, hasToken
-
Methods inherited from class ptolemy.actor.AbstractReceiver
getArray, getContainer, getCurrentTime, getModelTime, isKnown, putArray, putArrayToAll, putToAll, reset, setContainer, toString
-
-
-
-
Constructor Detail
-
SysMLAReceiver
public SysMLAReceiver() throws IllegalActionException
Construct a SysMLAReceiver.- Throws:
IllegalActionException
- If thrown by the superclass.
-
SysMLAReceiver
public SysMLAReceiver(IOPort container) throws IllegalActionException
Construct a SysMLAReceiver.- Parameters:
container
- The container for this SysMLAReceiver.- Throws:
IllegalActionException
- If thrown by the superclass.
-
-
Method Detail
-
get
public Token get() throws NoTokenException
Get the contained Token. If there is none, throw an exception. The token is removed.- Specified by:
get
in interfaceReceiver
- Overrides:
get
in classMailbox
- Returns:
- The token contained by this mailbox.
- Throws:
NoTokenException
- If this mailbox is empty.
-
put
public void put(Token token)
Put a token into the queue for containing actor.
-
reallyPut
public void reallyPut(Token token) throws NoRoomException
Put a token into the mailbox.- Parameters:
token
- The token to be put into the mailbox.- Throws:
NoRoomException
- If this mailbox is not empty.
-
-