|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.multiverse.api.clock.SingleThreadedPrimitiveClock
public final class SingleThreadedPrimitiveClock
A PrimitiveClock implementation that can be used in a single thread environment. It is useful if you want
to use the atomic behavior of the stm but don't need it to be thread-safe.
| Constructor Summary | |
|---|---|
SingleThreadedPrimitiveClock()
|
|
| Method Summary | |
|---|---|
long |
getVersion()
Returns the current version of this PrimitiveClock. |
long |
strictTick()
Executes a strict clock tick by increasing the version. |
long |
tick()
Executes a clock tick by increasing the version. |
long |
tickTo(long version)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SingleThreadedPrimitiveClock()
| Method Detail |
|---|
public long tick()
PrimitiveClockPrimitiveClock.getVersion() method will always return a time equal
or larger than.the last tick.
The returned value could be stale as soon as it is received.
tick in interface PrimitiveClockPrimitiveClock.strictTick()public long strictTick()
PrimitiveClockPrimitiveClock.tick() is that the former will always increase the version for every calling thread and the
is allowed to return the same version for concurrent ticks.
The returned value could be stale as soon as it is received.
strictTick in interface PrimitiveClockPrimitiveClock.tick()public long getVersion()
PrimitiveClock
getVersion in interface PrimitiveClockpublic long tickTo(long version)
tickTo in interface PrimitiveClockpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||