net.corda.node.utilities

## Class MutableClock

- net.corda.node.utilities.MutableClock

- Direct Known Subclasses:
    TestClock

      public class MutableClock

  An abstract class with helper methods for a type of Clock that might have it's concept of "now" adjusted externally.

  e.g. for testing (so unit tests do not have to wait for timeouts in realtime) or for demos and simulations.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MutableClock()` An abstract class with helper methods for a type of Clock that might have it's concept of "now" adjusted externally.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `getMutationCount()` This tracks how many direct mutations of "now" have occurred for this Clock, but not the passage of time.
    `rx.Observable<java.lang.Long>` | `getMutations()` This is an observer on the mutation count of this Clock, which reflects the occurence of mutations.
    `void` | `notifyMutationObservers()` Must be called by subclasses when they mutate (but not just with the passage of time as per the "wall clock").

- - ### Constructor Detail

    - #### MutableClock

          public MutableClock()

      An abstract class with helper methods for a type of Clock that might have it's concept of "now" adjusted externally.

      e.g. for testing (so unit tests do not have to wait for timeouts in realtime) or for demos and simulations.

  - ### Method Detail

    - #### getMutationCount

          public long getMutationCount()

      This tracks how many direct mutations of "now" have occurred for this Clock, but not the passage of time.

      It starts at zero, and increments by one per mutation.

      See Also:
        Clock

    - #### getMutations

          public rx.Observable<java.lang.Long> getMutations()

      This is an observer on the mutation count of this Clock, which reflects the occurence of mutations.

      See Also:
        Clock

    - #### notifyMutationObservers

          public void notifyMutationObservers()

      Must be called by subclasses when they mutate (but not just with the passage of time as per the "wall clock").