Class MaxSizedFloatArrayList

java.lang.Object
org.apache.lucene.internal.hppc.FloatArrayList
org.apache.lucene.internal.hppc.MaxSizedFloatArrayList
All Implemented Interfaces:
Cloneable, Iterable<FloatCursor>, Accountable

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

    • MaxSizedFloatArrayList

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

      public MaxSizedFloatArrayList(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).
    • MaxSizedFloatArrayList

      public MaxSizedFloatArrayList(MaxSizedFloatArrayList list)
      Creates a new list from the elements of another list in its iteration order.
  • Method Details

    • ensureBufferSpace

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

      public int hashCode()
      Overrides:
      hashCode in class FloatArrayList
    • 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 FloatArrayList
    • ramBytesUsed

      public long ramBytesUsed()
      Description copied from interface: Accountable
      Return the memory usage of this object in bytes. Negative values are illegal.
      Specified by:
      ramBytesUsed in interface Accountable
      Overrides:
      ramBytesUsed in class FloatArrayList