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 and Description |
---|
MutableClock()
An abstract class with helper methods for a type of Clock that might have it's concept of "now"
adjusted externally.
|
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").
|
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.
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.
public rx.Observable<java.lang.Long> getMutations()
This is an observer on the mutation count of this Clock, which reflects the occurence of mutations.
public void notifyMutationObservers()
Must be called by subclasses when they mutate (but not just with the passage of time as per the "wall clock").