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 protected
StateBasedPNCounter()
protected
StateBasedPNCounter(long adds, long removes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PNCounter
decrement()
Decrement the counter and get the result.long
decrementAndGet()
Decrement the counter and get the result.long
get()
Get the current value.long
getAndDecrement()
Decrement the counter and get the result.long
getAndIncrement()
Increment the counter and get the result.long
getDecrement()
Get the amount that the value decremented.long
getIncrement()
Get the amount that the value incremented.PNCounter
increment()
Increment the counter and get the result.long
incrementAndGet()
Increment the counter and get the result.PNCounter
merge(Count other)
Merge the supplied counter into this counter.String
toString()
-
-
-
Method Detail
-
increment
public PNCounter increment()
Description copied from interface:PNCounter
Increment the counter and get the result.
-
decrement
public PNCounter decrement()
Description copied from interface:PNCounter
Decrement the counter and get the result.
-
incrementAndGet
public long incrementAndGet()
Description copied from interface:GCounter
Increment the counter and get the result.- Specified by:
incrementAndGet
in interfaceGCounter
- Returns:
- the current result after incrementing
-
decrementAndGet
public long decrementAndGet()
Description copied from interface:PNCounter
Decrement the counter and get the result.- Specified by:
decrementAndGet
in interfacePNCounter
- Returns:
- the current result after decrementing
-
getAndIncrement
public long getAndIncrement()
Description copied from interface:GCounter
Increment the counter and get the result.- Specified by:
getAndIncrement
in interfaceGCounter
- Returns:
- the current result before incrementing
-
getAndDecrement
public long getAndDecrement()
Description copied from interface:PNCounter
Decrement the counter and get the result.- Specified by:
getAndDecrement
in interfacePNCounter
- Returns:
- the current result before decrementing
-
get
public long get()
Description copied from interface:PNCount
Get the current value.
-
getIncrement
public long getIncrement()
Description copied from interface:GCount
Get the amount that the value incremented.- Specified by:
getIncrement
in interfaceGCount
- Returns:
- the incremented value
-
getDecrement
public long getDecrement()
Description copied from interface:PNCount
Get the amount that the value decremented. Thevalue
is thetotal increments
minus thetotal decrements
- Specified by:
getDecrement
in interfacePNCount
- Returns:
- the decremented value
-
merge
public PNCounter merge(Count other)
Description copied from interface:PNCounter
Merge the supplied counter into this counter.
-
-