public class FunctionTable extends DefaultDataTable
For example, a query like 'select id, id * 2, 8 * 9 from Part' the columns 'id * 2' and '8 * 9' would be formed from this table.
SYNCHRONIZATION ISSUE: Instances of this object are NOT thread safe. The reason it's not is because if 'getCellContents' is used concurrently it's possible for the same value to be added into the cache causing an error. It is not expected that this object will be shared between threads.
row_count
DEBUG_QUERY
Constructor and Description |
---|
FunctionTable(Expression[] exp_list,
String[] col_names,
DatabaseQueryContext context) |
FunctionTable(Table cross_ref_table,
Expression[] in_exp_list,
String[] col_names,
DatabaseQueryContext context)
Constructs the FunctionTable.
|
Modifier and Type | Method and Description |
---|---|
void |
createGroupMatrix(Variable[] col_list)
Creates a grouping matrix for the given tables.
|
TObject |
getCellContents(int column,
int row)
Returns an object that represents the information in the given cell
in the table.
|
DataTableDef |
getDataTableDef()
Returns the DataTableDef object that represents the columns in this
function table.
|
Table |
getReferenceTable()
Returns the Table this function is based on.
|
IntegerVector |
groupRows(int group_number)
Returns an IntegerVector that represents the list of all rows in the
group the index is at.
|
int |
groupSize(int group_number)
The size of the group with the given number.
|
boolean |
hasRootsLocked()
Returns true if the table has its row roots locked (via the lockRoot(int)
method.
|
void |
lockRoot(int lock_key)
Locks the root table(s) of this table so that it is impossible to
overwrite the underlying rows that may appear in this table.
|
Table |
mergeWithReference(Variable max_column)
Returns a Table that is this function table merged with the cross
reference table.
|
static Table |
resultTable(DatabaseQueryContext context,
Expression expression)
Returns a FunctionTable that has a single Expression evaluated in it.
|
static Table |
resultTable(DatabaseQueryContext context,
int result_val)
Returns a FunctionTable that has an int value made into a BigDecimal.
|
static Table |
resultTable(DatabaseQueryContext context,
Object ob)
Returns a FunctionTable that has a single Object in it.
|
static Table |
resultTable(DatabaseQueryContext context,
TObject ob)
Returns a FunctionTable that has a single TObject in it.
|
RowEnumeration |
rowEnumeration()
Returns an Enumeration of the rows in this table.
|
int |
rowGroup(int row_index)
Returns the group of the row at the given index.
|
void |
setWholeTableAsGroup()
Sets the whole reference table as a single group.
|
void |
unlockRoot(int lock_key)
Unlocks the root tables so that the underlying rows may
once again be used if they are not locked and have been removed.
|
blankSelectableSchemes, blankSelectableSchemes, clearColumnScheme, findFieldName, getColumnCount, getDatabase, getResolvedVariable, getRootColumnScheme, getRowCount
getTableName, toString, typeEquals
all, allColumnMatchesValue, any, columnContainsCell, columnContainsValue, columnMatchesValue, columnMerge, compareCells, Debug, distinct, distinct, dumpTo, emptySelect, exhaustiveSelect, fastFindFieldName, getColumnDefAt, getColumnScheme, getFirstCellContent, getFirstCellContent, getLastCellContent, getLastCellContent, getSingleCellContent, getSingleCellContent, getSystem, getTableAccessState, getTTypeForColumn, getTTypeForColumn, join, orderByColumn, orderByColumn, orderByColumn, orderByColumns, orderedRowList, outside, printGraph, rangeSelect, selectAll, selectAll, selectFirst, selectLast, selectRange, selectRest, simpleJoin, simpleSelect, singleRowSelect, toMap, union
public FunctionTable(Table cross_ref_table, Expression[] in_exp_list, String[] col_names, DatabaseQueryContext context)
public FunctionTable(Expression[] exp_list, String[] col_names, DatabaseQueryContext context)
public void setWholeTableAsGroup()
public void createGroupMatrix(Variable[] col_list)
public Table getReferenceTable()
public int rowGroup(int row_index)
public int groupSize(int group_number)
public IntegerVector groupRows(int group_number)
public Table mergeWithReference(Variable max_column)
The 'max_column' argument is optional (can be null). If it's set to a column in the reference table, then the row with the max value from the group is used as the group row. For example, 'Part.id' will return the row with the maximum part.id from each group.
public DataTableDef getDataTableDef()
getDataTableDef
in interface TableDataSource
getDataTableDef
in class Table
public TObject getCellContents(int column, int row)
getCellContents
in interface TableDataSource
getCellContents
in class Table
public RowEnumeration rowEnumeration()
rowEnumeration
in interface TableDataSource
rowEnumeration
in class Table
public void lockRoot(int lock_key)
public void unlockRoot(int lock_key)
unlockRoot
in class Table
public boolean hasRootsLocked()
hasRootsLocked
in class Table
public static Table resultTable(DatabaseQueryContext context, Expression expression)
public static Table resultTable(DatabaseQueryContext context, TObject ob)
public static Table resultTable(DatabaseQueryContext context, Object ob)
public static Table resultTable(DatabaseQueryContext context, int result_val)
Copyright © 2015. All rights reserved.