A representation of the Logootish Document Model for mapping "real,"
known_positions to Logoot positions. This is useful when working
with strings, arrays, or, just in general, anything that needs a fixed order.
This does not actually store the data in question, but stores a mapping of
real indices in the data to the Logoot positions of that element. This is
used to transform edits between ones in the Logoot and local position spaces.
One important thing to note: Logoot edits (insertions/removals) can be
applied in any order. Local edits must be applied in a consistent order.
This is a Lamport clock. A proper vector clock would have too many entries for large, multi-user documents. See the Logoot paper for why. Unlike the Logoot implementation, this is incremented with each removal only and is kept constant with insertions.
An optional instance of the
ListDocumentModel.Logger class to log all
operations that modify the BST (all calls to
_mergeNode) to help with
bug identification when applicable.
The BST maps out where all insertion nodes are in the local document's memory. It is used to go from position -> node
This BST maps Logoot position identifiers to their text node to allow lookup of text position from Logoot ID
This is the most important method in the
ListDocumentModel. This method
adds atoms to the BSTs. By consequence, it replaces nodes and generates
conflicts as necessary to add the node to the BST. Users should never
call this function directly.
The branch to insert on
The start Logoot position of the insertion
The length of the insertion
The clock value for the insertion
The type of node to add. Anything other than data will result in data being removed if it conflicts on the same branch
JoinFunction to determine if two node groups should
be joined together in the same conflict group
The goal of this method is to find the Logoot position corresponding to a
particular local position. Unlike the old version, this does not
actually record the insertion. The output of this must be passed in to
insertLogoot for that to happen. This provides greater flexibility for
the programmer. All insertions will be determined on the
of this class. This means that if this funcion is called and the start
position is in between two atoms, the first on
branch and the second not,
the resulting order will leave the new atom after the first atom, but not
necessarily after the second atom since conflicts allow atoms to appear
out of their Logoot order. However, if an insertion is attempted between
two atoms on branches that are not
branch, then it will not be possible
to determine where the resulting node should go. A
will be thrown. UI should respond to this by informing the user to resolve
the conflict first.
The position of the insertion
The length of the insertion
An object containing
start (a LogootPosition),
start value is
the only one that is actually calculated. The others are returned for
Finds the sets of Logoot positions in a certain real text range. This is
used to find the removal operations to perform, but it does not
actually record the updates, just like
The position to start removing, inclusive.
The length of the removal
removals. Each removal has a
startLogootPosition, a numeric
branch(which is a BranchKey), and a
rclkvector clock value.
An extremely expensive operation that scans the BSTs for obvious signs of corruption (empty CGs, non-continuous ldoc, out-of-order ldoc, etc.)
Generated using TypeDoc