Class IncrementalModificationCounter
- java.lang.Object
-
- com.exonum.binding.storage.database.IncrementalModificationCounter
-
- All Implemented Interfaces:
ModificationCounter
public final class IncrementalModificationCounter extends Object implements ModificationCounter
-
-
Constructor Summary
Constructors Constructor Description IncrementalModificationCounter()
-
Method Summary
Modifier and Type Method Description intgetCurrentValue()Returns the current value of the counter.booleanisModifiedSince(int lastValue)Returns true if the counter was modified since the given value (ifModificationCounter.notifyModified()has been invoked); false — otherwise.voidnotifyModified()Notifies this counter that the source object is modified, updating its current value.
-
-
-
Method Detail
-
isModifiedSince
public boolean isModifiedSince(int lastValue)
Description copied from interface:ModificationCounterReturns true if the counter was modified since the given value (ifModificationCounter.notifyModified()has been invoked); false — otherwise.- Specified by:
isModifiedSincein interfaceModificationCounter- Parameters:
lastValue- the last value of the counter
-
getCurrentValue
public int getCurrentValue()
Description copied from interface:ModificationCounterReturns the current value of the counter. No assumptions must be made on how it changes when a notification is received.- Specified by:
getCurrentValuein interfaceModificationCounter
-
notifyModified
public void notifyModified()
Description copied from interface:ModificationCounterNotifies this counter that the source object is modified, updating its current value.- Specified by:
notifyModifiedin interfaceModificationCounter
-
-