public class IntMemArrayQuickSorter extends MemArrayQuickSorter
QuickSorter
implementation for a memory block which stores an array of int
s.
Memory is accessed using the provided MemoryAccessor
.baseAddress, mem
Constructor and Description |
---|
IntMemArrayQuickSorter(MemoryAccessor mem,
long baseAddress) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
isGreaterThanPivot(long index) |
protected boolean |
isLessThanPivot(long index) |
protected void |
loadPivot(long index)
Loads the data from the given index as needed to satisfy later calls to
QuickSorter.isLessThanPivot(long)
and QuickSorter.isGreaterThanPivot(long) . |
protected void |
swap(long index1,
long index2)
Swaps the contents of the slots at the supplied indices.
|
gotoAddress
sort
public IntMemArrayQuickSorter(MemoryAccessor mem, long baseAddress)
protected void loadPivot(long index)
QuickSorter
QuickSorter.isLessThanPivot(long)
and QuickSorter.isGreaterThanPivot(long)
.loadPivot
in class QuickSorter
index
- the index from which to load the data.protected boolean isLessThanPivot(long index)
isLessThanPivot
in class QuickSorter
index
- the supplied index.true
if the slot at the supplied index is "less than" the slot remembered by the
previous call to QuickSorter.loadPivot(long)
; false
otherwise.protected boolean isGreaterThanPivot(long index)
isGreaterThanPivot
in class QuickSorter
index
- the supplied index.true
if the slot at the supplied index is "greater than" the slot remembered by the
previous call to QuickSorter.loadPivot(long)
; false
otherwise.protected void swap(long index1, long index2)
QuickSorter
swap
in class QuickSorter
index1
- the index from which to swap contents.index2
- the other index from which to swap contents.Copyright © 2021 Hazelcast, Inc.. All Rights Reserved.