Class AbstractStruct

java.lang.Object
io.keikai.doc.collab.structs.AbstractStruct
Direct Known Subclasses:
GC, Item, Skip

public class AbstractStruct extends Object
  • Constructor Details

    • AbstractStruct

      public AbstractStruct(ID id, int length)
      Parameters:
      id -
      length -
  • Method Details

    • getId

      public ID getId()
    • length

      public int length()
    • setLength

      public void setLength(int length)
    • isDeleted

      public boolean isDeleted()
      Returns:
      boolean indicating if this struct is deleted
    • mergeWith

      public boolean mergeWith(AbstractStruct right)
      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

      public void write(Object encoder, int offset, int encodingRef)
      Write data to the encoder.
      Parameters:
      encoder - The encoder to write data to.
      offset -
      encodingRef -
    • write

      public void write(UpdateEncoder encoder, int offset)
      Write data to the encoder.
      Parameters:
      encoder - The encoder to write data to.
      offset -
    • integrate

      public void integrate(Transaction transaction, int offset)
      Integrate this struct into a transaction.
      Parameters:
      transaction -
      offset -