Class RegisterReceiver

  • All Implemented Interfaces:
    Receiver

    public class RegisterReceiver
    extends Mailbox
    A receiver which extends Mailbox and holds a single token.
    Since:
    Ptolemy II 10.0
    Version:
    $Id$
    Author:
    Elizabeth Latronico (Bosch)
    Pt.AcceptedRating:
    Red (beth)
    Pt.ProposedRating:
    Red (beth)
    • Constructor Detail

      • RegisterReceiver

        public RegisterReceiver()
        Construct an empty RegisterReceiver with no container.
      • RegisterReceiver

        public RegisterReceiver​(IOPort container)
                         throws IllegalActionException
        Construct an empty RegisterReceiver 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
        Get the contained Token. If there is none, throw an exception.
        Specified by:
        get in interface Receiver
        Overrides:
        get in class Mailbox
        Returns:
        The token contained by this receiver.
        Throws:
        NoTokenException - If this receiver is empty.
      • put

        public void put​(Token token)
                 throws NoRoomException
        Put a token into the registerReceiver.
        Specified by:
        put in interface Receiver
        Overrides:
        put in class Mailbox
        Parameters:
        token - The token to be put into the mailbox, or null to set the mailbox to empty.
        Throws:
        NoRoomException - Not thrown in this base class.