Class QueuedTypedIOPort

    • Constructor Detail

      • QueuedTypedIOPort

        public QueuedTypedIOPort​(ComponentEntity container,
                                 java.lang.String name,
                                 boolean isInput,
                                 boolean isOutput)
                          throws IllegalActionException,
                                 NameDuplicationException
        Construct a QueuedTypedIOPort with a container and a name that is either an input, an output, or both, depending on the third and fourth arguments. The specified container must implement the TypedActor interface or an exception will be thrown.
        Parameters:
        container - The container actor.
        name - The name of the port.
        isInput - True if this is to be an input port.
        isOutput - True if this is to be an output port.
        Throws:
        IllegalActionException - If the port is not of an acceptable class for the container, or if the container does not implement the TypedActor interface.
        NameDuplicationException - If the name coincides with a port already in the container.
    • Method Detail

      • setSize

        public void setSize​(int size,
                            Token initialValue)
        Set the size of the queue. This operation will clear whatever is currently enqueued and create a queue of the new size.
        Parameters:
        size - The size of the queue.
        initialValue - The initial value of the queue.
      • resize

        public void resize​(int size)
        Set the size of the queue. This operation will clear whatever is currently enqueued and create a queue of the new size.
        Parameters:
        size - The size of the queue.
      • clear

        public void clear()
        Clear the queue.
      • setInitToken

        public void setInitToken​(Token initialValue)
        Set the initial token value.
        Parameters:
        initialValue - The initial value of the token.
      • send

        public void send​(int channelIndex,
                         Token token)
                  throws IllegalActionException,
                         NoRoomException
        Enqueue the token that is being sent and send to the parent whatever is at the end of the queue.
        Overrides:
        send in class TypedIOPort
        Parameters:
        channelIndex - The channel on which to send the token.
        token - The token to be sent.
        Throws:
        IllegalActionException - If thrown while sending to the channel.
        NoRoomException - If thrown while sending to the channel.