Class BigList.Block<T>

All Implemented Interfaces:
Serializable, Cloneable, Iterable<T>, Collection<T>, List<T>, RandomAccess, SequencedCollection<T>, ICollection<T>, IListable<T>
Enclosing class:
BigList<E>

static class BigList.Block<T> extends GapList<T>
A block stores in maximum blockSize number of elements. The first block in a BigList will grow until reaches this limit, all other blocks are directly allocated with a capacity of blockSize. A block maintains a reference count which allows a block to be shared among different BigList instances with a copy-on-write approach.
  • Field Details

  • Constructor Details

    • Block

      public Block()
    • Block

      public Block(int capacity)
    • Block

      public Block(BigList.Block<T> that)
  • Method Details

    • isShared

      public boolean isShared()
      Returns:
      true if block is shared by several BigList instances
    • ref

      public BigList.Block<T> ref()
      Increment reference count as block is used by one BigList instance more.
    • unref

      public void unref()
      Decrement reference count as block is no longer used by one BigList instance.