public class AtomicLongPosition extends java.lang.Object implements Position
Position that is backed by an AtomicLong that is useful for tests.| Constructor and Description |
|---|
AtomicLongPosition() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
long |
get()
Get the current position of a component without memory ordering semantics.
|
long |
getVolatile()
Get the current position of a component with volatile semantics
|
int |
id()
Identifier for this position.
|
boolean |
isClosed()
Has this Position been closed?
|
boolean |
proposeMax(long proposedValue)
Set the position to the new proposedValue if it is greater than the current proposedValue memory ordering semantics.
|
boolean |
proposeMaxOrdered(long proposedValue)
Set the position to the new proposedValue if it is greater than the current proposedValue with ordered atomic
memory semantics.
|
void |
set(long value)
Sets the current position of the component without memory ordering semantics.
|
void |
setOrdered(long value)
Sets the current position of the component with ordered atomic memory semantics.
|
public boolean isClosed()
Positionpublic int id()
ReadablePositionid in interface ReadablePositionpublic long get()
Positionpublic long getVolatile()
ReadablePositiongetVolatile in interface ReadablePositionpublic void set(long value)
Positionpublic void setOrdered(long value)
PositionsetOrdered in interface Positionvalue - the current position of the component.public boolean proposeMax(long proposedValue)
PositionproposeMax in interface PositionproposedValue - for the new max.public boolean proposeMaxOrdered(long proposedValue)
PositionproposeMaxOrdered in interface PositionproposedValue - for the new max.public void close()
close in interface java.lang.AutoCloseableclose in interface ReadablePositionCopyright © 2014 - 2016 Real Logic Ltd. All Rights Reserved.