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 int
getCurrentValue()
Returns the current value of the counter.boolean
isModifiedSince(int lastValue)
Returns true if the counter was modified since the given value (ifModificationCounter.notifyModified()
has been invoked); false — otherwise.void
notifyModified()
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:ModificationCounter
Returns true if the counter was modified since the given value (ifModificationCounter.notifyModified()
has been invoked); false — otherwise.- Specified by:
isModifiedSince
in interfaceModificationCounter
- Parameters:
lastValue
- the last value of the counter
-
getCurrentValue
public int getCurrentValue()
Description copied from interface:ModificationCounter
Returns the current value of the counter. No assumptions must be made on how it changes when a notification is received.- Specified by:
getCurrentValue
in interfaceModificationCounter
-
notifyModified
public void notifyModified()
Description copied from interface:ModificationCounter
Notifies this counter that the source object is modified, updating its current value.- Specified by:
notifyModified
in interfaceModificationCounter
-
-