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
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.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final classRepresents a page ofPAGE_CAPACITYobjects in the overall array.protected class -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()protected Eget(int index) Returns the element from the array at the specified indexprotected AbstractPagedArray.Page<E> getOrCreateEntryPage(int index) Utility methods that retrieves or initializes aAbstractPagedArray.Pagebased on the absolute index in the array.protected AbstractPagedArray.Page<E> getPage(int index) Utility methods that retrieves anAbstractPagedArray.Pagebased on the absolute index in the array.protected ESets the specified index to the provided elementprotected static inttoPageIndex(int index) protected static inttoPageOffset(int index)
-
Field Details
-
elementPages
-
-
Constructor Details
-
AbstractPagedArray
public AbstractPagedArray()
-
-
Method Details
-
toPageIndex
protected static int toPageIndex(int index) -
toPageOffset
protected static int toPageOffset(int index) -
getPage
Utility methods that retrieves anAbstractPagedArray.Pagebased 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
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
Sets the specified index to the provided element- Parameters:
index- the absolute index in the underlying arrayelement- the element to set- Returns:
- the value previously contained in the array at the specified position, or
null
-
getOrCreateEntryPage
Utility methods that retrieves or initializes aAbstractPagedArray.Pagebased 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()
-