Class MaxSizedIntArrayList

  • All Implemented Interfaces:
    Cloneable, Iterable<IntCursor>, Accountable

    public class MaxSizedIntArrayList
    extends IntArrayList
    An array-backed list of int with a maximum size limit.
    NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
    • Constructor Detail

      • MaxSizedIntArrayList

        public MaxSizedIntArrayList​(int maxSize)
        New instance with sane defaults.
      • MaxSizedIntArrayList

        public MaxSizedIntArrayList​(int maxSize,
                                    int expectedElements)
        New instance with sane defaults.
        Parameters:
        maxSize - The maximum size this list can grow to
        expectedElements - The expected number of elements guaranteed not to cause buffer expansion (inclusive).
      • MaxSizedIntArrayList

        public MaxSizedIntArrayList​(MaxSizedIntArrayList list)
        Creates a new list from the elements of another list in its iteration order.
    • Method Detail

      • ensureBufferSpace

        protected void ensureBufferSpace​(int expectedAdditions)
        Description copied from class: IntArrayList
        Ensures the internal buffer has enough free slots to store expectedAdditions. Increases internal buffer size if needed.
        Overrides:
        ensureBufferSpace in class IntArrayList
      • equals

        public boolean equals​(Object obj)
        Returns true only if the other object is an instance of the same class and with the same elements and maxSize.
        Overrides:
        equals in class IntArrayList