Class LinearizabilityChecker.History

  • Enclosing class:
    LinearizabilityChecker

    public static class LinearizabilityChecker.History
    extends java.lang.Object
    Sequence of invocations and responses, recording the run of a concurrent system.
    • Method Summary

      Modifier and Type Method Description
      LinearizabilityChecker.History clone()  
      void complete​(java.util.function.Function<java.lang.Object,​java.lang.Object> missingResponseGenerator)
      Completes the history with response events for invocations that are missing corresponding responses
      java.util.List<LinearizabilityChecker.Event> copyEvents()
      Copy the list of events for external use.
      int invoke​(java.lang.Object input)
      Appends a new invocation event to the history
      void remove​(int id)
      Removes the events with the corresponding id from the history
      void respond​(int id, java.lang.Object output)
      Appends a new response event to the history
      int size()
      Returns the number of recorded events
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • invoke

        public int invoke​(java.lang.Object input)
        Appends a new invocation event to the history
        Parameters:
        input - the input value associated with the invocation event
        Returns:
        an id that can be used to record the corresponding response event
      • respond

        public void respond​(int id,
                            java.lang.Object output)
        Appends a new response event to the history
        Parameters:
        id - the id of the corresponding invocation event
        output - the output value associated with the response event
      • remove

        public void remove​(int id)
        Removes the events with the corresponding id from the history
        Parameters:
        id - the value of the id to remove
      • copyEvents

        public java.util.List<LinearizabilityChecker.Event> copyEvents()
        Copy the list of events for external use.
        Returns:
        list of events in the order recorded.
      • complete

        public void complete​(java.util.function.Function<java.lang.Object,​java.lang.Object> missingResponseGenerator)
        Completes the history with response events for invocations that are missing corresponding responses
        Parameters:
        missingResponseGenerator - a function from invocation input to response output, used to generate the corresponding response
      • size

        public int size()
        Returns the number of recorded events
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object