Package io.keikai.doc.collab.utils
Class DeleteSet
java.lang.Object
io.keikai.doc.collab.utils.DeleteSet
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddToDeleteSet(DeleteSet ds, int client, int clock, int length) static DeleteSetstatic DeleteSetstatic booleanequalDeleteSets(DeleteSet ds1, DeleteSet ds2) static IntegerfindIndexDS(List<DeleteItem> dis, int clock) static booleanstatic voiditerateDeletedStructs(Transaction transaction, DeleteSet ds, Consumer<AbstractStruct> f) Iterate over all structs that the DeleteSet gc's.static DeleteSetmergeDeleteSets(List<DeleteSet> dss) static Uint8ArrayreadAndApplyDeleteSet(DSDecoder decoder, Transaction transaction, StructStore store) static DeleteSetreadDeleteSet(DSDecoder decoder) Overloaded readDeleteSet for DSDecoderstatic voidstatic voidwriteDeleteSet(io.keikai.doc.collab.utils.DSEncoder encoder, DeleteSet ds) Internal used only.
-
Constructor Details
-
DeleteSet
public DeleteSet()
-
-
Method Details
-
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
- Parameters:
dis-clock-- Returns:
- Integer
-
isDeleted
- Parameters:
ds-id-- Returns:
- boolean
-
sortAndMergeDeleteSet
- Parameters:
ds-
-
mergeDeleteSets
- Parameters:
dss-- Returns:
- DeleteSet
-
addToDeleteSet
- Parameters:
ds-client-clock-length-
-
createDeleteSet
- Returns:
- DeleteSet
-
createDeleteSetFromStructStore
- Parameters:
ss-- Returns:
- DeleteSet
-
writeDeleteSet
Internal used only.- Parameters:
encoder-ds-
-
readDeleteSet
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
- Parameters:
ds1-ds2-- Returns:
- boolean
-