Class Station

  • All Implemented Interfaces:
    ReceiveQObjectIfc, ObservableIfc, GetNameIfc, IdentityIfc
    Direct Known Subclasses:
    DelayStation, NWayByChanceStationSender, SingleQueueStation, TwoWayByChanceStationSender

    public abstract class Station
    extends SchedulingElement
    implements ReceiveQObjectIfc
    A Station represents a location that can receive QObjects for processing. Sub-classes of Station must supply an implementation of the ReceiveQObjectIfc interface. A Station may or may not have a helper object that implements the SendQObjectIfc interface. If this helper object is supplied it will be used to send the processed QObject to its next location for processing. A Station may or may not have a helper object that implements the ReceiveQObjectIfc interface. If this helper object is supplied and the SendQObjectIfc helper is not supplied, then the object that implements the ReceiveQObjectIfc will be the next receiver for the QObject If neither helper object is supplied then a runtime exception will occur when trying to use the send() method
    • Constructor Detail

      • Station

        public Station​(ModelElement parent)
        Parameters:
        parent - the parent model element
      • Station

        public Station​(ModelElement parent,
                       java.lang.String name)
        Parameters:
        parent - the parent model element
        name - a unique name
      • Station

        public Station​(ModelElement parent,
                       SendQObjectIfc sender,
                       java.lang.String name)
        Parameters:
        parent - the parent model element
        sender - can be null, represents something that can send QObjects
        name - a unique name
    • Method Detail

      • getSender

        public final SendQObjectIfc getSender()
        A Station may or may not have a helper object that implements the SendQObjectIfc interface. If this helper object is supplied it will be used to send the processed QObject to its next location for processing.
        Returns:
        the thing that will be used to send the completed QObject
      • setSender

        public final void setSender​(SendQObjectIfc sender)
        A Station may or may not have a helper object that implements the SendQObjectIfc interface. If this helper object is supplied it will be used to send the processed QObject to its next location for processing.
        Parameters:
        sender - the thing that will be used to send the completed QObject
      • getNextReceiver

        public final ReceiveQObjectIfc getNextReceiver()
        A Station may or may not have a helper object that implements the ReceiveQObjectIfc interface. If this helper object is supplied and the SendQObjectIfc helper is not supplied, then the object that implements the ReceiveQObjectIfc will be the next receiver for the QObject when using default send() method.
        Returns:
        the thing that should receive the completed QObject, may be null
      • setNextReceiver

        public final void setNextReceiver​(ReceiveQObjectIfc receiver)
        A Station may or may not have a helper object that implements the ReceiveQObjectIfc interface. If this helper object is supplied and the SendQObjectIfc helper is not supplied, then the object that implements the ReceiveQObjectIfc will be the next receiver for the QObject when using default send() method.
        Parameters:
        receiver - the thing that should receive the completed QObject, may be null
      • send

        protected void send​(QObject qObj)
        A Station may or may not have a helper object that implements the SendQObjectIfc interface. If this helper object is supplied it will be used to send the processed QObject to its next location for processing. A Station may or may not have a helper object that implements the ReceiveQObjectIfc interface. If this helper object is supplied and the SendQObjectIfc helper is not supplied, then the object that implements the ReceiveQObjectIfc will be the next receiver for the QObject If neither helper object is supplied then a runtime exception will occur when trying to use the send() method
        Parameters:
        qObj - the completed QObject