Interface DiffContext<T,K extends java.lang.Comparable>
- Type Parameters:
T
- Value typeK
- Key type
public interface DiffContext<T,K extends java.lang.Comparable>
Implementors of this interface support being notified of changes to an ordered array.
-
Method Summary
Modifier and Type Method Description void
added(K newDocId, T newDoc)
A document with the specified ID has been added.void
addedBefore(K newDocId, T newDoc, K beforeId)
Indicates that the new document with the given ID should be inserted before the givenbeforeId
.java.util.function.Function<T,K>
getKeyer()
default java.lang.Object
lock()
void
movedBefore(K id, K beforeId)
void
possiblyChanged(K newDocId, T oldDoc, T newDoc)
void
removed(K id)
Indicates that the given ID should be removed.
-
Method Details
-
removed
Indicates that the given ID should be removed.- Parameters:
id
- The ID of the record to remove.
-
addedBefore
Indicates that the new document with the given ID should be inserted before the givenbeforeId
. IfbeforeId
isnull
, this document should be added to the very end of the list.- Parameters:
newDocId
-newDoc
-beforeId
- The document to insertnewDoc
before, ornull
if the document should be added to the end of the list.
-
added
A document with the specified ID has been added.- Parameters:
newDocId
-newDoc
-
-
possiblyChanged
-
movedBefore
-
getKeyer
-
lock
default java.lang.Object lock()
-