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.Page
s, 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 class
Represents a page ofPAGE_CAPACITY
objects in the overall array.protected class
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
protected E
get
(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.Page
based on the absolute index in the array.protected AbstractPagedArray.Page<E>
getPage
(int index) Utility methods that retrieves anAbstractPagedArray.Page
based on the absolute index in the array.protected E
Sets the specified index to the provided elementprotected static int
toPageIndex
(int index) protected static int
toPageOffset
(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.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
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.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()
-