Interface DiffContext<T,​K extends java.lang.Comparable>

Type Parameters:
T - Value type
K - 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 given beforeId.
    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

      void removed​(K id)
      Indicates that the given ID should be removed.
      Parameters:
      id - The ID of the record to remove.
    • addedBefore

      void addedBefore​(K newDocId, T newDoc, @Nullable K beforeId)
      Indicates that the new document with the given ID should be inserted before the given beforeId. If beforeId is null, this document should be added to the very end of the list.
      Parameters:
      newDocId -
      newDoc -
      beforeId - The document to insert newDoc before, or null if the document should be added to the end of the list.
    • added

      void added​(K newDocId, T newDoc)
      A document with the specified ID has been added.
      Parameters:
      newDocId -
      newDoc -
    • possiblyChanged

      void possiblyChanged​(K newDocId, T oldDoc, T newDoc)
    • movedBefore

      void movedBefore​(K id, @Nullable K beforeId)
    • getKeyer

      java.util.function.Function<T,​K> getKeyer()
    • lock

      default java.lang.Object lock()