Package io.keikai.doc.collab.structs
Class AbstractStruct
java.lang.Object
io.keikai.doc.collab.structs.AbstractStruct
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetId()voidintegrate(Transaction transaction, int offset) Integrate this struct into a transaction.booleanintlength()booleanmergeWith(AbstractStruct right) Merge this struct with the item to the right.voidsetLength(int length) voidwrite(UpdateEncoder encoder, int offset) Write data to the encoder.voidWrite data to the encoder.
-
Constructor Details
-
AbstractStruct
- Parameters:
id-length-
-
-
Method Details
-
getId
-
length
public int length() -
setLength
public void setLength(int length) -
isDeleted
public boolean isDeleted()- Returns:
- boolean indicating if this struct is deleted
-
mergeWith
Merge this struct with the item to the right. This method assumes that `this.id.clock + this.length === right.id.clock`. Also, this method does *not* remove the right struct from the StructStore!- Parameters:
right-- Returns:
- boolean indicating whether this struct merged with the right struct
-
write
Write data to the encoder.- Parameters:
encoder- The encoder to write data to.offset-encodingRef-
-
write
Write data to the encoder.- Parameters:
encoder- The encoder to write data to.offset-
-
integrate
Integrate this struct into a transaction.- Parameters:
transaction-offset-
-