public abstract class SelectableScheme extends Object
A given element in the set is specified through a 'row' integer whose contents can be obtained through the 'table.getCellContents(column, row)'. Every scheme is given a table and column number that the set refers to. While a given set element is refered to as a 'row', the integer is really only a pointer into the set list which can be de-referenced with a call to table.getCellContents(row). Better performance schemes will keep such calls to a minimum.
A scheme may choose to retain knowledge about a given element when it is added or removed from the set, such as a BinaryTree that catalogs all elements with respect to each other.
Modifier and Type | Field and Description |
---|---|
protected static BlockIntegerList |
EMPTY_LIST
Some statics.
|
protected static BlockIntegerList |
ONE_LIST |
Constructor and Description |
---|
SelectableScheme(TableDataSource table,
int column)
The constructor for all schemes.
|
Modifier and Type | Method and Description |
---|---|
abstract SelectableScheme |
copy(TableDataSource table,
boolean immutable)
Returns an exact copy of this scheme including any optimization
information.
|
protected DebugLogger |
Debug()
Returns the DebugLogger object to log debug messages to.
|
abstract void |
dispose()
Dispose and invalidate this scheme.
|
protected TObject |
getCellContents(int row)
Obtains the given cell in the row from the table.
|
protected int |
getColumn()
Returns the column this scheme is indexing in the table.
|
SelectableScheme |
getSubsetScheme(Table subset_table,
int subset_column)
Asks the Scheme for a SelectableScheme abject that describes a sub-set
of the set handled by this Scheme.
|
protected TransactionSystem |
getSystem()
Returns the global transaction system.
|
protected TableDataSource |
getTable()
Returns the Table.
|
BlockIntegerList |
internalOrderIndexSet(IntegerVector row_set)
Returns a BlockIntegerList that represents the given row_set sorted
in the order of this scheme.
|
boolean |
isImmutable()
Returns true if this scheme is immutable.
|
abstract void |
readFrom(InputStream in)
Reads the entire contents of the scheme from a InputStream object.
|
IntegerVector |
selectAll()
These are the select operations that are the main purpose of the scheme.
|
IntegerVector |
selectAllNonNull()
Selects all values in the column that are not null.
|
IntegerVector |
selectBetween(TObject ob1,
TObject ob2) |
IntegerVector |
selectEqual(TObject ob) |
IntegerVector |
selectFirst() |
IntegerVector |
selectGreater(TObject ob) |
IntegerVector |
selectGreaterOrEqual(TObject ob) |
IntegerVector |
selectLast() |
IntegerVector |
selectLess(TObject ob) |
IntegerVector |
selectLessOrEqual(TObject ob) |
IntegerVector |
selectNotEqual(TObject ob) |
IntegerVector |
selectNotFirst() |
IntegerVector |
selectNotLast() |
void |
setImmutable()
Sets this scheme to immutable.
|
String |
toString()
Diagnostic information.
|
abstract void |
writeTo(OutputStream out)
Writes the entire contents of the scheme to an OutputStream object.
|
protected static final BlockIntegerList EMPTY_LIST
protected static final BlockIntegerList ONE_LIST
public SelectableScheme(TableDataSource table, int column)
protected final TableDataSource getTable()
protected final TransactionSystem getSystem()
protected final DebugLogger Debug()
protected final int getColumn()
protected final TObject getCellContents(int row)
public final void setImmutable()
public final boolean isImmutable()
public abstract void writeTo(OutputStream out) throws IOException
IOException
public abstract void readFrom(InputStream in) throws IOException
IOException
public abstract SelectableScheme copy(TableDataSource table, boolean immutable)
The newly copied scheme can be given a new table source. If 'immutable' is true, then the resultant scheme is an immutable version of the parent. An immutable version may share information with the copied version so can not be changed.
NOTE: Even if the scheme maintains no state you should still be careful to ensure a fresh SelectableScheme object is returned here.
public abstract void dispose()
public BlockIntegerList internalOrderIndexSet(IntegerVector row_set)
The returned set must be stable, meaning if values are equal they keep the same ordering.
Note that the default implementation of this method can often be optimized. For example, InsertSearch uses a secondary RID list to sort items if the given list is over a certain size.
public SelectableScheme getSubsetScheme(Table subset_table, int subset_column)
public IntegerVector selectAll()
public IntegerVector selectFirst()
public IntegerVector selectNotFirst()
public IntegerVector selectLast()
public IntegerVector selectNotLast()
public IntegerVector selectAllNonNull()
public IntegerVector selectEqual(TObject ob)
public IntegerVector selectNotEqual(TObject ob)
public IntegerVector selectGreater(TObject ob)
public IntegerVector selectLess(TObject ob)
public IntegerVector selectGreaterOrEqual(TObject ob)
public IntegerVector selectLessOrEqual(TObject ob)
public IntegerVector selectBetween(TObject ob1, TObject ob2)
Copyright © 2015. All rights reserved.