A PNCounter (or Positive-Negative Counter) is a replicated counter that can be both incremented and decremented.
Each replica that modifies the counter is represented by a unique string ID.
PNCounter state
Constructor that creates a new PNCounter with the value zero.
Increment the PNCounter.
Decrement the PNCounter.
Get the current value of the PNCounter.
Merge two PNCounter states.
Operations that will modify the state of the counter.
Apply an operation on a PNCounter.
Apply a list of operations (a patch) on a PNCounter.
Encode a PNCounter as JSON.
Decode a PNCounter from JSON.
Each replica that modifies the counter is represented by a unique string ID.