- java.lang.Object
- 
- org.hsqldb.lib.DoubleLongIndex
 
- 
- All Implemented Interfaces:
- LongLookup
 
 public final class DoubleLongIndex extends java.lang.Object implements LongLookup Maintains an orderedlong->longlookup 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 - Since:
- 1.8.0
- Author:
- Fred Toussi (fredt@users dot sourceforge.net)
 
- 
- 
Constructor SummaryConstructors Constructor Description DoubleLongIndex(int capacity)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description intadd(long key, long value)booleanaddUnsorted(long key, long value)booleanaddUnsorted(LongLookup other)voidclear()booleancompactLookupAsIntervals()voidcopyTo(DoubleLongIndex other)LongLookupduplicate()intfindFirstEqualKeyIndex(long value)intfindFirstGreaterEqualKeyIndex(long value)intfindFirstGreaterEqualSlotIndex(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.longgetLongKey(int i)longgetLongValue(int i)longgetTotalValues()longlookup(long key)longlookup(long key, long def)voidsetLongValue(int i, long value)Modifies an existing pair.voidsetSize(int newSize)intsize()voidsort()
 
- 
- 
- 
Method Detail- 
getLongKeypublic long getLongKey(int i) - Specified by:
- getLongKeyin interface- LongLookup
 
 - 
getLongValuepublic long getLongValue(int i) - Specified by:
- getLongValuein interface- LongLookup
 
 - 
setLongValuepublic void setLongValue(int i, long value)Modifies an existing pair.- Specified by:
- setLongValuein interface- LongLookup
- Parameters:
- i- the index
- value- the value
 
 - 
sizepublic int size() - Specified by:
- sizein interface- LongLookup
 
 - 
getTotalValuespublic long getTotalValues() - Specified by:
- getTotalValuesin interface- LongLookup
 
 - 
setSizepublic void setSize(int newSize) 
 - 
addUnsortedpublic boolean addUnsorted(long key, long value)- Specified by:
- addUnsortedin interface- LongLookup
 
 - 
addpublic int add(long key, long value)- Specified by:
- addin interface- LongLookup
 
 - 
lookuppublic long lookup(long key) throws java.util.NoSuchElementException- Specified by:
- lookupin interface- LongLookup
- Throws:
- java.util.NoSuchElementException
 
 - 
lookuppublic long lookup(long key, long def)- Specified by:
- lookupin interface- LongLookup
 
 - 
clearpublic void clear() - Specified by:
- clearin interface- LongLookup
 
 - 
duplicatepublic LongLookup duplicate() - Specified by:
- duplicatein interface- LongLookup
 
 - 
findFirstGreaterEqualKeyIndexpublic int findFirstGreaterEqualKeyIndex(long value) - Parameters:
- value- the value
- Returns:
- the index
 
 - 
findFirstEqualKeyIndexpublic int findFirstEqualKeyIndex(long value) - Parameters:
- value- the value
- Returns:
- the index
 
 - 
findFirstGreaterEqualSlotIndexpublic 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.- Parameters:
- value- the value
- Returns:
- the index
 
 - 
compactLookupAsIntervalspublic boolean compactLookupAsIntervals() - Specified by:
- compactLookupAsIntervalsin interface- LongLookup
 
 - 
sortpublic void sort() - Specified by:
- sortin interface- LongLookup
 
 - 
copyTopublic void copyTo(DoubleLongIndex other) 
 - 
addUnsortedpublic boolean addUnsorted(LongLookup other) - Specified by:
- addUnsortedin interface- LongLookup
 
 
- 
 
-