public final class InsertSearch extends CollatedBaseSearch
This requires less memory than the BinaryTree, however it is not as fast. Even though, it should still perform fairly well on medium size data sets. On large size data sets, insert and remove performance may suffer.
This object retains knowledge of all set elements unlike BlindSearch which has no memory overhead.
Performance should be very comparable to BinaryTree for sets that aren't altered much.
EMPTY_LIST, ONE_LIST| Constructor and Description |
|---|
InsertSearch(TableDataSource table,
int column)
The Constructor.
|
InsertSearch(TableDataSource table,
int column,
IntegerVector vec)
Constructor sets the scheme with a pre-sorted list.
|
| Modifier and Type | Method and Description |
|---|---|
protected IntegerVector |
addRangeToSet(int start,
int end,
IntegerVector ivec)
Adds the set indexes to the list that represent the range of values
between the start (inclusive) and end offset (inclusive) given.
|
SelectableScheme |
copy(TableDataSource table,
boolean immutable)
Returns an exact copy of this scheme including any optimization
information.
|
void |
dispose()
Disposes this scheme.
|
protected TObject |
firstInCollationOrder()
Returns the first value of this column (in collated order).
|
void |
insert(int row)
Inserts a row into the list.
|
protected TObject |
lastInCollationOrder()
Returns the last value of this column (in collated order).
|
void |
readFrom(InputStream in)
Reads the entire state of the scheme from the input stream.
|
void |
remove(int row)
Removes a row from the list.
|
protected int |
searchFirst(TObject val)
Finds the position in the collated set of the first value in the column
equal to the given value.
|
protected int |
searchLast(TObject val)
Finds the position in the collated set of the last value in the column
equal to the given value.
|
IntegerVector |
selectAll()
The select operations for this scheme.
|
protected int |
setSize()
The size of the set (the number of rows in this column).
|
void |
writeTo(OutputStream out)
Writes the entire state of the scheme to the output stream.
|
selectRange, selectRangeDebug, getCellContents, getColumn, getSubsetScheme, getSystem, getTable, internalOrderIndexSet, isImmutable, selectAllNonNull, selectBetween, selectEqual, selectFirst, selectGreater, selectGreaterOrEqual, selectLast, selectLess, selectLessOrEqual, selectNotEqual, selectNotFirst, selectNotLast, setImmutable, toStringpublic InsertSearch(TableDataSource table, int column)
public InsertSearch(TableDataSource table, int column, IntegerVector vec)
public void insert(int row)
insert in class CollatedBaseSearchpublic void remove(int row)
remove in class CollatedBaseSearchpublic void readFrom(InputStream in) throws IOException
readFrom in class CollatedBaseSearchIOExceptionpublic void writeTo(OutputStream out) throws IOException
writeTo in class CollatedBaseSearchIOExceptionpublic SelectableScheme copy(TableDataSource table, boolean immutable)
copy in class SelectableSchemepublic void dispose()
dispose in class CollatedBaseSearchprotected int searchFirst(TObject val)
CollatedBaseSearchsearchFirst in class CollatedBaseSearchprotected int searchLast(TObject val)
CollatedBaseSearchsearchLast in class CollatedBaseSearchprotected int setSize()
CollatedBaseSearchsetSize in class CollatedBaseSearchprotected TObject firstInCollationOrder()
CollatedBaseSearchfirstInCollationOrder in class CollatedBaseSearchprotected TObject lastInCollationOrder()
CollatedBaseSearchlastInCollationOrder in class CollatedBaseSearchprotected IntegerVector addRangeToSet(int start, int end, IntegerVector ivec)
CollatedBaseSearchaddRangeToSet in class CollatedBaseSearchpublic IntegerVector selectAll()
selectAll in class CollatedBaseSearchCopyright © 2019. All rights reserved.