Class DeleteSet

java.lang.Object
io.keikai.doc.collab.utils.DeleteSet

public class DeleteSet extends Object
We no longer maintain a DeleteStore. DeleteSet is a temporary object that is created when needed. - When created in a transaction, it must only be accessed after sorting, and merging - This DeleteSet is sent to other clients - We do not create a DeleteSet when we send a sync message. The DeleteSet message is created directly from StructStore - We read a DeleteSet as part of a sync/update message. In this case the DeleteSet is already sorted and merged.
  • Constructor Details

    • DeleteSet

      public DeleteSet()
  • Method Details

    • getClients

      public Map<Integer,List<DeleteItem>> getClients()
    • iterateDeletedStructs

      public static void iterateDeletedStructs(Transaction transaction, DeleteSet ds, Consumer<AbstractStruct> f)
      Iterate over all structs that the DeleteSet gc's.
      Parameters:
      transaction -
      ds -
      f -
    • findIndexDS

      public static Integer findIndexDS(List<DeleteItem> dis, int clock)
      Parameters:
      dis -
      clock -
      Returns:
      Integer
    • isDeleted

      public static boolean isDeleted(DeleteSet ds, ID id)
      Parameters:
      ds -
      id -
      Returns:
      boolean
    • sortAndMergeDeleteSet

      public static void sortAndMergeDeleteSet(DeleteSet ds)
      Parameters:
      ds -
    • mergeDeleteSets

      public static DeleteSet mergeDeleteSets(List<DeleteSet> dss)
      Parameters:
      dss -
      Returns:
      DeleteSet
    • addToDeleteSet

      public static void addToDeleteSet(DeleteSet ds, int client, int clock, int length)
      Parameters:
      ds -
      client -
      clock -
      length -
    • createDeleteSet

      public static DeleteSet createDeleteSet()
      Returns:
      DeleteSet
    • createDeleteSetFromStructStore

      public static DeleteSet createDeleteSetFromStructStore(StructStore ss)
      Parameters:
      ss -
      Returns:
      DeleteSet
    • writeDeleteSet

      public static void writeDeleteSet(io.keikai.doc.collab.utils.DSEncoder encoder, DeleteSet ds)
      Internal used only.
      Parameters:
      encoder -
      ds -
    • readDeleteSet

      public static DeleteSet readDeleteSet(DSDecoder decoder)
      Overloaded readDeleteSet for DSDecoder
      Parameters:
      decoder -
      Returns:
      DeleteSet
    • readAndApplyDeleteSet

      public static Uint8Array readAndApplyDeleteSet(DSDecoder decoder, Transaction transaction, StructStore store)
      Parameters:
      decoder -
      transaction -
      store -
      Returns:
      Uint8Array
    • equalDeleteSets

      public static boolean equalDeleteSets(DeleteSet ds1, DeleteSet ds2)
      Parameters:
      ds1 -
      ds2 -
      Returns:
      boolean