public class SolutionIndex<T>
extends java.lang.Object
| Constructor and Description |
|---|
SolutionIndex(Query.QueryVariables queryVariables,
int totalPatterns)
Constructs a new solution index
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(Solution<T> s,
long now)
Adds a solution to this index.
|
java.util.Iterator<Solution<T>> |
composeSolutions(java.lang.String variable,
T value,
Solution<T> ps,
long now) |
java.util.Iterator<Solution<T>> |
getComposableSolutions(java.lang.String variable,
T value,
Solution<T> ps,
long now) |
java.util.Iterator<Solution<T>> |
getSolutions(java.lang.String variable,
T value,
long now)
Retrieves all unexpired solutions for a given variable/value pair
|
void |
joinSolutions(Solution<T> matchedSolution,
Bindings<T> bindings,
java.util.Stack<Solution<T>> solutions,
long now)
Finds the result of joining composable combinations of an original solution together with all
unexpired solutions containing any of a provided set of bindings.
|
int |
removeExpired(long now)
Removes all expired solutions from this index.
|
public SolutionIndex(Query.QueryVariables queryVariables, int totalPatterns)
queryVariables - the variables of the query for which this is an indextotalPatterns - the total number of tuple patterns in the query for which this is an indexpublic boolean add(Solution<T> s, long now)
s - the solution to addnow - the current time, in milliseconds since the Unix epochpublic java.util.Iterator<Solution<T>> getSolutions(java.lang.String variable, T value, long now)
variable - a query variablevalue - a value bound to a query variablenow - the current time, in milliseconds since the Unix epochpublic java.util.Iterator<Solution<T>> getComposableSolutions(java.lang.String variable, T value, Solution<T> ps, long now)
public java.util.Iterator<Solution<T>> composeSolutions(java.lang.String variable, T value, Solution<T> ps, long now)
public void joinSolutions(Solution<T> matchedSolution, Bindings<T> bindings, java.util.Stack<Solution<T>> solutions, long now)
matchedSolution - the initial solution produced by matching the tuple pattern against the tuplebindings - a set of bindingssolutions - a stack of solutions which will be cleared, and to which solutions will be addednow - the current clock timepublic int removeExpired(long now)
now - the current time, in milliseconds since the Unix epochCopyright © 2016. All Rights Reserved.