Class AbstractContent

    • Constructor Detail

      • AbstractContent

        public AbstractContent()
    • Method Detail

      • getLength

        public int getLength()
        Returns:
        the length of the content
      • getContent

        public java.util.List<java.lang.Object> getContent()
        Returns:
        the content as an array
      • isCountable

        public boolean isCountable()
        Should return false if this Item is some kind of meta information (e.g. format information). * Whether this Item should be addressable via `yarray.get(i)` * Whether this Item should be counted when computing yarray.length
        Returns:
        true if the content is countable, false otherwise
      • copy

        public AbstractContent copy()
        Creates a copy of this content.
        Returns:
        a new instance of AbstractContent
      • splice

        public AbstractContent splice​(int offset)
        Splices the content at the specified offset.
        Parameters:
        offset - the offset at which to splice the content
        Returns:
        a new instance of AbstractContent representing the spliced content
      • mergeWith

        public boolean mergeWith​(AbstractContent right)
        Merges this content with another content.
        Parameters:
        right - the content to merge with
        Returns:
        true if the merge was successful, false otherwise
      • integrate

        public void integrate​(Transaction transaction,
                              Item item)
        Integrates this content into a transaction.
        Parameters:
        transaction - the transaction to integrate into
        item - the item associated with this content
      • delete

        public void delete​(Transaction transaction)
        Deletes this content from a transaction.
        Parameters:
        transaction - the transaction to delete from
      • gc

        public void gc​(StructStore store)
        Performs garbage collection on this content.
        Parameters:
        store - the store in which to perform garbage collection
      • write

        public void write​(UpdateEncoder encoder,
                          int offset)
        Writes this content to an encoder.
        Parameters:
        encoder - the encoder to write to
        offset - the offset at which to write
      • getRef

        public int getRef()
        Returns:
        a reference ID for this content