Package io.debezium.crdt
Class StateBasedPNCounter
- java.lang.Object
-
- io.debezium.crdt.StateBasedPNCounter
-
- Direct Known Subclasses:
StateBasedPNDeltaCounter
@NotThreadSafe class StateBasedPNCounter extends Object implements PNCounter
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedStateBasedPNCounter()protectedStateBasedPNCounter(long adds, long removes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PNCounterdecrement()Decrement the counter and get the result.longdecrementAndGet()Decrement the counter and get the result.longget()Get the current value.longgetAndDecrement()Decrement the counter and get the result.longgetAndIncrement()Increment the counter and get the result.longgetDecrement()Get the amount that the value decremented.longgetIncrement()Get the amount that the value incremented.PNCounterincrement()Increment the counter and get the result.longincrementAndGet()Increment the counter and get the result.PNCountermerge(Count other)Merge the supplied counter into this counter.StringtoString()
-
-
-
Method Detail
-
increment
public PNCounter increment()
Description copied from interface:PNCounterIncrement the counter and get the result.
-
decrement
public PNCounter decrement()
Description copied from interface:PNCounterDecrement the counter and get the result.
-
incrementAndGet
public long incrementAndGet()
Description copied from interface:GCounterIncrement the counter and get the result.- Specified by:
incrementAndGetin interfaceGCounter- Returns:
- the current result after incrementing
-
decrementAndGet
public long decrementAndGet()
Description copied from interface:PNCounterDecrement the counter and get the result.- Specified by:
decrementAndGetin interfacePNCounter- Returns:
- the current result after decrementing
-
getAndIncrement
public long getAndIncrement()
Description copied from interface:GCounterIncrement the counter and get the result.- Specified by:
getAndIncrementin interfaceGCounter- Returns:
- the current result before incrementing
-
getAndDecrement
public long getAndDecrement()
Description copied from interface:PNCounterDecrement the counter and get the result.- Specified by:
getAndDecrementin interfacePNCounter- Returns:
- the current result before decrementing
-
get
public long get()
Description copied from interface:PNCountGet the current value.
-
getIncrement
public long getIncrement()
Description copied from interface:GCountGet the amount that the value incremented.- Specified by:
getIncrementin interfaceGCount- Returns:
- the incremented value
-
getDecrement
public long getDecrement()
Description copied from interface:PNCountGet the amount that the value decremented. Thevalueis thetotal incrementsminus thetotal decrements- Specified by:
getDecrementin interfacePNCount- Returns:
- the decremented value
-
merge
public PNCounter merge(Count other)
Description copied from interface:PNCounterMerge the supplied counter into this counter.
-
-