Class AbstractStruct

  • Direct Known Subclasses:
    GC, Item, Skip

    public class AbstractStruct
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractStruct​(ID id, int length)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      ID getId()  
      void integrate​(Transaction transaction, int offset)
      Integrate this struct into a transaction.
      boolean isDeleted()  
      int length()  
      boolean mergeWith​(AbstractStruct right)
      Merge this struct with the item to the right.
      void setLength​(int length)  
      void write​(UpdateEncoder encoder, int offset)
      Write data to the encoder.
      void write​(java.lang.Object encoder, int offset, int encodingRef)
      Write data to the encoder.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractStruct

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

      • 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​(java.lang.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 -