ptolemy.domains.wireless.kernel
Class WirelessReceiver

java.lang.Object
  extended byptolemy.actor.AbstractReceiver
      extended byptolemy.domains.de.kernel.DEReceiver
          extended byptolemy.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,v 1.15 2004/04/13 03:37:43 cxh Exp $
Author:
Edward A. Lee
Accepted Rating:
Yellow (cxh)
Proposed Rating:
Green (cxh)

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, double time)
          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
_triggerEvent, clear, getDirector, hasRoom, hasRoom, hasToken, hasToken, setDelay
 
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
 

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,
                double time)
         throws IllegalActionException
Override the base class to attach an empty properties token.

Overrides:
put in class DEReceiver
Parameters:
token - The token to put.
time - The time in the future.
Throws:
IllegalActionException - If there are problems creating the RecordToken or if the parent class throws it.
See Also:
DEReceiver.put(ptolemy.data.Token, double)

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.
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.
properties - The associated properties, or null to not put any in.