Package org.jcsp.lang

Class Guard

    • Constructor Summary

      Constructors 
      Constructor Description
      Guard()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) abstract boolean disable()
      Disables the guard for selection.
      (package private) abstract boolean enable​(Alternative alt)
      Returns true if the event is ready.
      protected void schedule​(Alternative alt)
      Schedules the process performing the given Alternative to run again.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Guard

        public Guard()
    • Method Detail

      • enable

        abstract boolean enable​(Alternative alt)
        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

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

        abstract boolean disable()
        Disables the guard for selection. Returns true if the event was ready.

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

        Returns:
        true if and only if the event was ready
      • schedule

        protected void schedule​(Alternative alt)
        Schedules the process performing the given Alternative to run again. This is intended for use by advanced users of the library who want to create their own Guards that are not in the org.jcsp.lang package.
        Parameters:
        alt - The Alternative to schedule