public class QueryMatches extends Object
Modifier and Type | Field and Description |
---|---|
int |
colcount |
Object[] |
columnDefinitions |
Object[][] |
data |
static int |
initialSize |
int |
last |
int |
size |
Constructor and Description |
---|
QueryMatches(Collection columnDefs,
QueryContext context)
INTERNAL: Creates a new matches object with the given column
definitions.
|
QueryMatches(QueryMatches matches)
INTERNAL: Creates a new (empty) matches object with the same
column definitions as the QueryMatches object passed in the
parameter.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Object[][] newdata,
int length)
EXPERIMENTAL: Adds input array to this table.
|
void |
add(QueryMatches extra)
INTERNAL: Adds all the matches in the given table to this table.
|
void |
add(QueryResultIF extra)
EXPERIMENTAL: Adds QueryResultIF matches to this table.
|
protected void |
addNonRedundant(QueryMatches matches)
INTERNAL: Adds all rows which do not already exist.
|
boolean |
bound(int colix)
INTERNAL: Checks whether the variable represented by the indexed
column is bound.
|
void |
clear()
INTERNAL: Empties the table.
|
String |
dump() |
void |
ensureCapacity(int requirement)
INTERNAL: Ensures that the table has at least the given size.
|
Object |
getColumnDefinition(int ix)
INTERNAL: Returns definition of column.
|
int |
getIndex(Float num)
INTERNAL: Returns the index of the given float constant in the table.
|
int |
getIndex(Integer num)
INTERNAL: Returns the index of the given integer constant in the table.
|
int |
getIndex(Object argument)
INTERNAL: Returns the column index of the given object in the
table.
|
int |
getIndex(String str)
INTERNAL: Returns the index of the given string constant in the table.
|
int |
getIndex(TMObjectIF constant)
INTERNAL: Returns the index of the given constant in the table.
|
int |
getIndex(Variable var)
INTERNAL: Returns the index of the given variable in the table.
|
QueryContext |
getQueryContext()
INTERNAL: Returns the query context.
|
int[][] |
getTranslationSpec(Object[] intarguments,
QueryMatches extmatches,
Object[] extarguments)
INTERNAL: Computes the translation specification array, which
gives the connection between this and the other match table.
|
int |
getVariableIndex(String varname)
INTERNAL: Returns the index of the given variable in the table.
|
boolean |
hasLiteralColumns()
INTERNAL: Checks whether any of the columns are literal columns
representing a literal in the query.
|
void |
increaseCapacity()
INTERNAL: Used to increase the size of the table when full.
|
void |
insertConstants()
INTERNAL: Inserts the constant values in the constant columns.
|
boolean |
isEmpty()
INTERNAL: Returns true if there are no matches.
|
QueryMatches |
merge(int[] intspec,
QueryMatches extmatches,
int[] extspec,
int[] equalpairs)
INTERNAL: Merges this match table (from inside a rule) with
another match table (from the calling context), producing a new
set of matches (corresponding to the result of the rule, as
viewed from the outside).
|
protected void |
remove(QueryMatches matches)
INTERNAL: Removes the rows which have matching counterparts in
the argument.
|
QueryMatches |
removeDuplicates() |
void |
translate(int[] fromCols,
QueryMatches toQM,
int[] toCols)
INTERNAL: Translates matches in this table into corresponding
matches in the other.
|
public static int initialSize
public int last
public int size
public Object[][] data
public Object[] columnDefinitions
public int colcount
public QueryMatches(Collection columnDefs, QueryContext context)
public QueryMatches(QueryMatches matches)
public int getVariableIndex(String varname)
public int getIndex(TMObjectIF constant)
public int getIndex(Variable var)
public int getIndex(String str)
public int getIndex(Integer num)
public int getIndex(Float num)
public int getIndex(Object argument)
public Object getColumnDefinition(int ix)
public void increaseCapacity()
public void ensureCapacity(int requirement)
public void clear()
public QueryContext getQueryContext()
public boolean hasLiteralColumns()
public boolean isEmpty()
public void insertConstants()
public boolean bound(int colix)
public void add(QueryMatches extra)
public void add(Object[][] newdata, int length)
public void add(QueryResultIF extra)
protected void remove(QueryMatches matches)
protected void addNonRedundant(QueryMatches matches)
public int[][] getTranslationSpec(Object[] intarguments, QueryMatches extmatches, Object[] extarguments) throws InvalidQueryException
intarguments
- Actual received parameters in rule invocation.extarguments
- Declared parameters in rule declaration.InvalidQueryException
public void translate(int[] fromCols, QueryMatches toQM, int[] toCols)
public QueryMatches merge(int[] intspec, QueryMatches extmatches, int[] extspec, int[] equalpairs)
intspec
- Mapping from general column no (?) to column no in
this QM object.extspec
- Mapping from general column no (?) to column no in
extmatches.equalpairs
- See RulePredicate.getEqualPairs() for explanation.
Numbers are argument numbers.public QueryMatches removeDuplicates()
public String dump()