Package org.jcsp.lang

Class AltingChannelOutputIntSymmetricImpl

java.lang.Object
org.jcsp.lang.Guard
org.jcsp.lang.AltingChannelOutputInt
org.jcsp.lang.AltingChannelOutputIntSymmetricImpl
All Implemented Interfaces:
ChannelOutputInt, MultiwaySynchronisation, Poisonable

class AltingChannelOutputIntSymmetricImpl extends AltingChannelOutputInt implements MultiwaySynchronisation
  • Field Details

  • Constructor Details

  • Method Details

    • enable

      boolean enable(Alternative alt)
      Description copied from class: Guard
      Returns true if the event is ready. Otherwise, this enables the guard for selection and returns false.

      Note: this method should only be called by the Alternative class

      Specified by:
      enable in class Guard
      Parameters:
      alt - the Alternative class that is controlling the selection
      Returns:
      true if and only if the event is ready
    • disable

      boolean disable()
      Description copied from class: Guard
      Disables the guard for selection. Returns true if the event was ready.

      Note: this method should only be called by the Alternative class

      Specified by:
      disable in class Guard
      Returns:
      true if and only if the event was ready
    • write

      public void write(int i)
      Description copied from interface: ChannelOutputInt
      Write an int to the channel.
      Specified by:
      write in interface ChannelOutputInt
      Parameters:
      i - the integer to write to the channel
    • pending

      public boolean pending()
      Description copied from class: AltingChannelOutputInt
      Returns whether the receiver is committed to read from this channel.

      Note: if this returns true, you must commit to write down this channel.

      Specified by:
      pending in class AltingChannelOutputInt
      Returns:
      state of the channel.
    • poison

      public void poison(int strength)
      Description copied from interface: Poisonable
      This injects poison into the channel. If the channel was not explicitly constructed to be poisonable or if the strength of poison is not greater than the channel immunity level, the poison will have no effect.
      Specified by:
      poison in interface Poisonable
      Parameters:
      strength - the strength of the poison (must be >= 0).