long->long lookup table, consisting of two
columns, one for keys, the other for values. Equal keys are allowed.The table is sorted on key column.
findXXX() methods return the array index into the list pair containing a matching key or value, or -1 if not found.
Based on org.hsqldb.lib.DoubleIntIndex
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private int | |
| private long[] | |
| private boolean | |
| private long | |
| private long[] |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public int | |
| public boolean | |
| public boolean | |
| private int | Returns: index or -1 if not foundReturns the index of the lowest element == the given search target, or -1 |
| private int | Returns: the index or countignored fullCompare)Returns the index of the lowest element |
| public void | |
| public boolean | |
| private int | Returns: -1, 0 or +1the index i)Check if targeted column value in the row indexed i is less than the search target object. |
| public void | |
| private void | |
| public LongLookup | |
| private boolean | |
| private void | |
| private void | |
| public int | |
| public int | |
| public int | Returns: the indexthe value value)This method is similar to findFirstGreaterEqualKeyIndex(int) but returns the index of the empty row past the end of the array if the search value is larger than all the values / keys in the searched column. |
| public long | |
| public long | |
| public long | |
| private void | |
| private boolean | Returns: true or falsethe first index i, int the second index j)Check if row indexed i is less than row indexed j |
| public long | |
| public long | |
| private void | |
| private void | |
| private int | |
| private void | |
| public void | setLongValue(int
the index i, long the value value)Implements org. Modifies an existing pair. |
| public void | |
| public int | |
| public void | |
| private void |
| capacity | back to summary |
|---|---|
| private int capacity | |
| count | back to summary |
|---|---|
| private int count | |
| keys | back to summary |
|---|---|
| private long[] keys | |
| sorted | back to summary |
|---|---|
| private boolean sorted | |
| targetSearchValue | back to summary |
|---|---|
| private long targetSearchValue | |
| values | back to summary |
|---|---|
| private long[] values | |
| DoubleLongIndex | back to summary |
|---|---|
| public DoubleLongIndex(int capacity) | |
| add | back to summary |
|---|---|
| public int add(long key, long value) Implements org. | |
| addUnsorted | back to summary |
|---|---|
| public boolean addUnsorted(long key, long value) Implements org. | |
| addUnsorted | back to summary |
|---|---|
| public boolean addUnsorted(LongLookup other) Implements org. | |
| binaryFirstSearch | back to summary |
|---|---|
| private int binaryFirstSearch() Returns the index of the lowest element == the given search target, or -1
| |
| binarySlotSearch | back to summary |
|---|---|
| private int binarySlotSearch(boolean fullCompare) Returns the index of the lowest element
| |
| clear | back to summary |
|---|---|
| public void clear() Implements org. | |
| compactLookupAsIntervals | back to summary |
|---|---|
| public boolean compactLookupAsIntervals() Implements org. | |
| compare | back to summary |
|---|---|
| private int compare(int i) Check if targeted column value in the row indexed i is less than the search target object.
| |
| copyTo | back to summary |
|---|---|
| public void copyTo(DoubleLongIndex other) | |
| doubleCapacity | back to summary |
|---|---|
| private void doubleCapacity() | |
| duplicate | back to summary |
|---|---|
| public LongLookup duplicate() Implements org. | |
| ensureCapacityToAdd | back to summary |
|---|---|
| private boolean ensureCapacityToAdd(int extra) | |
| fastQuickSort | back to summary |
|---|---|
| private void fastQuickSort() fast quicksort using a stack on the heap to reduce stack use | |
| fastQuickSortRecursive | back to summary |
|---|---|
| private void fastQuickSortRecursive() fast quicksort with recursive quicksort implementation | |
| findFirstEqualKeyIndex | back to summary |
|---|---|
public int findFirstEqualKeyIndex(long value)
| |
| findFirstGreaterEqualKeyIndex | back to summary |
|---|---|
public int findFirstGreaterEqualKeyIndex(long value)
| |
| findFirstGreaterEqualSlotIndex | back to summary |
|---|---|
| public int findFirstGreaterEqualSlotIndex(long value) This method is similar to findFirstGreaterEqualKeyIndex(int) but returns the index of the empty row past the end of the array if the search value is larger than all the values / keys in the searched column.
| |
| getLongKey | back to summary |
|---|---|
| public long getLongKey(int i) Implements org. | |
| getLongValue | back to summary |
|---|---|
| public long getLongValue(int i) Implements org. | |
| getTotalValues | back to summary |
|---|---|
| public long getTotalValues() Implements org. | |
| insertionSort | back to summary |
|---|---|
| private void insertionSort(int lo0, int hi0) | |
| lessThan | back to summary |
|---|---|
| private boolean lessThan(int i, int j) Check if row indexed i is less than row indexed j
| |
| lookup | back to summary |
|---|---|
| public long lookup(long key) throws NoSuchElementException Implements org. | |
| lookup | back to summary |
|---|---|
| public long lookup(long key, long def) Implements org. | |
| moveAndInsertRow | back to summary |
|---|---|
| private void moveAndInsertRow(int i, int j) | |
| moveRows | back to summary |
|---|---|
| private void moveRows(int fromIndex, int toIndex, int rows) | |
| partition | back to summary |
|---|---|
| private int partition(int start, int end) | |
| quickSort | back to summary |
|---|---|
| private void quickSort(int l, int r) | |
| setLongValue | back to summary |
|---|---|
| public void setLongValue(int i, long value) Implements org. Modifies an existing pair.
| |
| setSize | back to summary |
|---|---|
| public void setSize(int newSize) | |
| size | back to summary |
|---|---|
| public int size() Implements org. | |
| sort | back to summary |
|---|---|
| public void sort() Implements org. | |
| swap | back to summary |
|---|---|
| private void swap(int i1, int i2) | |