Class AbstractPagedArray<E>

java.lang.Object
org.hibernate.internal.util.collections.AbstractPagedArray<E>
Type Parameters:
E - the type of elements contained in the array
Direct Known Subclasses:
InstanceIdentityMap, InstanceIdentityStore

public class AbstractPagedArray<E> extends Object
Array-like structures that organizes elements in AbstractPagedArray.Pages, automatically allocating more as needed. Access to data via absolute index is efficient as it requires a constant amount of operations.
  • Field Details

  • Constructor Details

    • AbstractPagedArray

      public AbstractPagedArray()
  • Method Details

    • toPageIndex

      protected static int toPageIndex(int index)
    • toPageOffset

      protected static int toPageOffset(int index)
    • getPage

      protected AbstractPagedArray.Page<E> getPage(int index)
      Utility methods that retrieves an AbstractPagedArray.Page based on the absolute index in the array.
      Parameters:
      index - the absolute index of the array
      Returns:
      the page corresponding to the provided index, or null
    • get

      protected E get(int index)
      Returns the element from the array at the specified index
      Parameters:
      index - the absolute index in the underlying array
      Returns:
      the value contained in the array at the specified position, or null
    • set

      protected E set(int index, E element)
      Sets the specified index to the provided element
      Parameters:
      index - the absolute index in the underlying array
      element - the element to set
      Returns:
      the value previously contained in the array at the specified position, or null
    • getOrCreateEntryPage

      protected AbstractPagedArray.Page<E> getOrCreateEntryPage(int index)
      Utility methods that retrieves or initializes a AbstractPagedArray.Page based on the absolute index in the array.
      Parameters:
      index - the absolute index of the array
      Returns:
      the page corresponding to the provided index
    • clear

      public void clear()