| java.lang.Object org.hsqldb.lib.DoubleIntIndex
DoubleIntIndex | public class DoubleIntIndex implements IntLookup(Code) | | Maintains an ordered integer->integer lookup table, consisting of two
columns, one for keys, the other for values.
The table is sorted on either the key or value column, depending on the calls to
setKeysSearchTarget() or setValuesSearchTarget(). By default, the table is
sorted on values.
findXXX() methods return the array index into the list
pair containing a matching key or value, or or -1 if not found.
Sorting methods originally contributed by Tony Lai.
author: fredt@users version: 1.8.0 since: 1.8.0 |
Constructor Summary | |
public | DoubleIntIndex(int capacity, boolean fixedSize) |
Method Summary | |
public synchronized boolean | add(int key, int value) Adds a pair, maintaining sorted order
current search target column. | public synchronized boolean | addSorted(int key, int value) Adds a key, value pair into the table with the guarantee that the key
is equal or larger than the largest existing key. | public synchronized boolean | addUnique(int key, int value) Adds a pair, ensuring no duplicate key xor value already exists in the
current search target column. | public synchronized boolean | addUnsorted(int key, int value) Adds a pair into the table. | public synchronized int | capacity() | public synchronized int | findFirstEqualKeyIndex(int value) | public synchronized int | findFirstGreaterEqualKeyIndex(int value) | public synchronized int | findFirstGreaterEqualSlotIndex(int 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 synchronized int | getKey(int i) | public synchronized int | getValue(int i) | public int | lookupFirstEqual(int key) | public int | lookupFirstGreaterEqual(int key) | final public synchronized void | remove(int position) | public void | removeAll() | public void | removeRange(int start, int limit) | public synchronized void | setKey(int i, int key) Modifies an existing pair. | public synchronized void | setKeysSearchTarget() | public synchronized void | setValue(int i, int value) Modifies an existing pair. | public synchronized void | setValuesSearchTarget() | public synchronized int | size() |
DoubleIntIndex | public DoubleIntIndex(int capacity, boolean fixedSize)(Code) | | |
add | public synchronized boolean add(int key, int value)(Code) | | Adds a pair, maintaining sorted order
current search target column.
Parameters: key - the key Parameters: value - the value true or false depending on success |
addSorted | public synchronized boolean addSorted(int key, int value)(Code) | | Adds a key, value pair into the table with the guarantee that the key
is equal or larger than the largest existing key. This prevents a sort
from taking place on next call to find()
Parameters: key - the key Parameters: value - the value true or false depending on success |
addUnique | public synchronized boolean addUnique(int key, int value)(Code) | | Adds a pair, ensuring no duplicate key xor value already exists in the
current search target column.
Parameters: key - the key Parameters: value - the value true or false depending on success |
addUnsorted | public synchronized boolean addUnsorted(int key, int value)(Code) | | Adds a pair into the table.
Parameters: key - the key Parameters: value - the value true or false depending on success |
capacity | public synchronized int capacity()(Code) | | |
findFirstEqualKeyIndex | public synchronized int findFirstEqualKeyIndex(int value)(Code) | | Parameters: value - the value the index |
findFirstGreaterEqualKeyIndex | public synchronized int findFirstGreaterEqualKeyIndex(int value)(Code) | | Parameters: value - the value the index |
findFirstGreaterEqualSlotIndex | public synchronized int findFirstGreaterEqualSlotIndex(int value)(Code) | | 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.
Parameters: value - the value the index |
getKey | public synchronized int getKey(int i)(Code) | | |
getValue | public synchronized int getValue(int i)(Code) | | |
remove | final public synchronized void remove(int position)(Code) | | |
removeAll | public void removeAll()(Code) | | |
removeRange | public void removeRange(int start, int limit)(Code) | | |
setKey | public synchronized void setKey(int i, int key)(Code) | | Modifies an existing pair.
Parameters: i - the index Parameters: key - the key |
setKeysSearchTarget | public synchronized void setKeysSearchTarget()(Code) | | |
setValue | public synchronized void setValue(int i, int value)(Code) | | Modifies an existing pair.
Parameters: i - the index Parameters: value - the value |
setValuesSearchTarget | public synchronized void setValuesSearchTarget()(Code) | | |
size | public synchronized int size()(Code) | | |
|
|