ptolemy.domains.wireless.kernel
Class WirelessReceiver

java.lang.Object
  extended by ptolemy.actor.AbstractReceiver
      extended by ptolemy.domains.de.kernel.DEReceiver
          extended by ptolemy.domains.wireless.kernel.WirelessReceiver
All Implemented Interfaces:
Receiver

public class WirelessReceiver
extends DEReceiver

A receiver for use in the wireless domain.

This receiver overrides the base class to handle transmission properties. This receiver works by bundling the token and its transmission properties into a record token, and then unbundling at the corresponding get() methods. FIXME: properties should be a RecordToken instead of Token. But I couldn't fix this until we can create an empty record token. yang

Since:
Ptolemy II 4.0
Version:
$Id: WirelessReceiver.java 57040 2010-01-27 20:52:32Z cxh $
Author:
Edward A. Lee
Accepted Rating:
Yellow (cxh)
Proposed Rating:
Green (cxh)

Field Summary
private  Token _dummy
           
private  Token _properties
           
 
Fields inherited from class ptolemy.domains.de.kernel.DEReceiver
_directorVersion, _tokens
 
Constructor Summary
WirelessReceiver()
          Construct an empty WirelessReceiver with no container.
WirelessReceiver(IOPort container)
          Construct an empty WirelessReceiver with the specified container.
 
Method Summary
 Token get()
          Override the base class to unbundle the token and its properties.
 Token getProperties()
          Return the properties token associated with the most recent call to get(), or null if there was none.
 void put(Token token)
          Override the base class to attach an empty properties token.
 void put(Token token, Token properties)
          Put the specified token bundled with the specified properties.
 
Methods inherited from class ptolemy.domains.de.kernel.DEReceiver
clear, elementList, hasRoom, hasRoom, hasToken, hasToken
 
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

_dummy

private Token _dummy

_properties

private Token _properties
Constructor Detail

WirelessReceiver

public WirelessReceiver()
Construct an empty WirelessReceiver with no container.


WirelessReceiver

public WirelessReceiver(IOPort container)
                 throws IllegalActionException
Construct an empty WirelessReceiver with the specified container.

Parameters:
container - The container.
Throws:
IllegalActionException - If the container does not accept this receiver.
Method Detail

get

public Token get()
          throws NoTokenException
Override the base class to unbundle the token and its properties. After this is called, the properties are available via the getProperties() method.

Specified by:
get in interface Receiver
Overrides:
get in class DEReceiver
Returns:
The next token in the receiver.
Throws:
NoTokenException - If there are no more tokens. This is a runtime exception, so it need not be declared explicitly.
See Also:
getProperties(), Receiver.get()

getProperties

public Token getProperties()
Return the properties token associated with the most recent call to get(), or null if there was none.

Returns:
A properties token or null.

put

public void put(Token token)
Override the base class to attach an empty properties token.

Specified by:
put in interface Receiver
Overrides:
put in class DEReceiver
Parameters:
token - The token to put, or null to send no token.
See Also:
DEReceiver.put(ptolemy.data.Token)

put

public void put(Token token,
                Token properties)
Put the specified token bundled with the specified properties.

Parameters:
token - The token to put, or null to send no token.
properties - The associated properties, or null to not put any in.