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, selectRange
Debug, getCellContents, getColumn, getSubsetScheme, getSystem, getTable, internalOrderIndexSet, isImmutable, selectAllNonNull, selectBetween, selectEqual, selectFirst, selectGreater, selectGreaterOrEqual, selectLast, selectLess, selectLessOrEqual, selectNotEqual, selectNotFirst, selectNotLast, setImmutable, toString
public InsertSearch(TableDataSource table, int column)
public InsertSearch(TableDataSource table, int column, IntegerVector vec)
public void insert(int row)
insert
in class CollatedBaseSearch
public void remove(int row)
remove
in class CollatedBaseSearch
public void readFrom(InputStream in) throws IOException
readFrom
in class CollatedBaseSearch
IOException
public void writeTo(OutputStream out) throws IOException
writeTo
in class CollatedBaseSearch
IOException
public SelectableScheme copy(TableDataSource table, boolean immutable)
copy
in class SelectableScheme
public void dispose()
dispose
in class CollatedBaseSearch
protected int searchFirst(TObject val)
CollatedBaseSearch
searchFirst
in class CollatedBaseSearch
protected int searchLast(TObject val)
CollatedBaseSearch
searchLast
in class CollatedBaseSearch
protected int setSize()
CollatedBaseSearch
setSize
in class CollatedBaseSearch
protected TObject firstInCollationOrder()
CollatedBaseSearch
firstInCollationOrder
in class CollatedBaseSearch
protected TObject lastInCollationOrder()
CollatedBaseSearch
lastInCollationOrder
in class CollatedBaseSearch
protected IntegerVector addRangeToSet(int start, int end, IntegerVector ivec)
CollatedBaseSearch
addRangeToSet
in class CollatedBaseSearch
public IntegerVector selectAll()
selectAll
in class CollatedBaseSearch
Copyright © 2015. All rights reserved.