Class QueryMatches
java.lang.Object
net.ontopia.topicmaps.query.impl.basic.QueryMatches
INTERNAL: Object used to hold query results during computation.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionQueryMatches(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. -
Method Summary
Modifier and TypeMethodDescriptionvoidEXPERIMENTAL: Adds input array to this table.voidadd(QueryResultIF extra) EXPERIMENTAL: Adds QueryResultIF matches to this table.voidadd(QueryMatches extra) INTERNAL: Adds all the matches in the given table to this table.protected voidaddNonRedundant(QueryMatches matches) INTERNAL: Adds all rows which do not already exist.booleanbound(int colix) INTERNAL: Checks whether the variable represented by the indexed column is bound.voidclear()INTERNAL: Empties the table.dump()voidensureCapacity(int requirement) INTERNAL: Ensures that the table has at least the given size.getColumnDefinition(int ix) INTERNAL: Returns definition of column.intINTERNAL: Returns the index of the given float constant in the table.intINTERNAL: Returns the index of the given integer constant in the table.intINTERNAL: Returns the column index of the given object in the table.intINTERNAL: Returns the index of the given string constant in the table.intgetIndex(TMObjectIF constant) INTERNAL: Returns the index of the given constant in the table.intINTERNAL: Returns the index of the given variable in the table.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.intgetVariableIndex(String varname) INTERNAL: Returns the index of the given variable in the table.booleanINTERNAL: Checks whether any of the columns are literal columns representing a literal in the query.voidINTERNAL: Used to increase the size of the table when full.voidINTERNAL: Inserts the constant values in the constant columns.booleanisEmpty()INTERNAL: Returns true if there are no matches.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 voidremove(QueryMatches matches) INTERNAL: Removes the rows which have matching counterparts in the argument.voidtranslate(int[] fromCols, QueryMatches toQM, int[] toCols) INTERNAL: Translates matches in this table into corresponding matches in the other.
-
Field Details
-
initialSize
public static int initialSize -
last
public int last -
size
public int size -
data
-
columnDefinitions
-
colcount
public int colcount
-
-
Constructor Details
-
QueryMatches
INTERNAL: Creates a new matches object with the given column definitions. -
QueryMatches
INTERNAL: Creates a new (empty) matches object with the same column definitions as the QueryMatches object passed in the parameter.
-
-
Method Details
-
getVariableIndex
INTERNAL: Returns the index of the given variable in the table. -
getIndex
INTERNAL: Returns the index of the given constant in the table. -
getIndex
INTERNAL: Returns the index of the given variable in the table. -
getIndex
INTERNAL: Returns the index of the given string constant in the table. -
getIndex
INTERNAL: Returns the index of the given integer constant in the table. -
getIndex
INTERNAL: Returns the index of the given float constant in the table. -
getIndex
INTERNAL: Returns the column index of the given object in the table. -
getColumnDefinition
INTERNAL: Returns definition of column. -
increaseCapacity
public void increaseCapacity()INTERNAL: Used to increase the size of the table when full. -
ensureCapacity
public void ensureCapacity(int requirement) INTERNAL: Ensures that the table has at least the given size. -
clear
public void clear()INTERNAL: Empties the table. -
getQueryContext
INTERNAL: Returns the query context. -
hasLiteralColumns
public boolean hasLiteralColumns()INTERNAL: Checks whether any of the columns are literal columns representing a literal in the query. -
isEmpty
public boolean isEmpty()INTERNAL: Returns true if there are no matches. -
insertConstants
public void insertConstants()INTERNAL: Inserts the constant values in the constant columns. Uses the information in the column definitions to do this. -
bound
public boolean bound(int colix) INTERNAL: Checks whether the variable represented by the indexed column is bound. -
add
INTERNAL: Adds all the matches in the given table to this table. Note that the two tables must have the same layout. -
add
EXPERIMENTAL: Adds input array to this table. -
add
EXPERIMENTAL: Adds QueryResultIF matches to this table. -
remove
INTERNAL: Removes the rows which have matching counterparts in the argument. -
addNonRedundant
INTERNAL: Adds all rows which do not already exist. Matching ignores nulls in the rows being added. -
getTranslationSpec
public int[][] getTranslationSpec(Object[] intarguments, QueryMatches extmatches, Object[] extarguments) throws InvalidQueryException INTERNAL: Computes the translation specification array, which gives the connection between this and the other match table.- Parameters:
intarguments- Actual received parameters in rule invocation.extarguments- Declared parameters in rule declaration.- Returns:
- an array of type int[][] that looks like [intspec, extspec], where intspec is the specification for this match and extspec is the specification for the other match.
- Throws:
InvalidQueryException
-
translate
INTERNAL: Translates matches in this table into corresponding matches in the other. -
merge
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).- Parameters:
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.
-
removeDuplicates
-
dump
-