Class IntBigList.IntBlock

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, IIntListable
    Enclosing class:
    IntBigList

    static class IntBigList.IntBlock
    extends IntGapList
    A block stores in maximum blockSize number of elements. The first block in a IntBigList 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 IntBigList instances with a copy-on-write approach.
    • Field Detail

      • refCount

        private java.util.concurrent.atomic.AtomicInteger refCount
    • Constructor Detail

      • IntBlock

        public IntBlock()
      • IntBlock

        public IntBlock​(int capacity)
    • Method Detail

      • isShared

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

        public IntBigList.IntBlock ref()
        Increment reference count as block is used by one IntBigList instance more.
      • unref

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