public class Query<T,S> extends java.lang.Object implements java.lang.Comparable<Query<T,S>>
QueryIndex.renew().| Modifier and Type | Class and Description |
|---|---|
static class |
Query.PatternInQuery<T,C>
A tuple pattern with a reference to the containing query, as well as its index within that query
|
static class |
Query.QueryVariables
An array of variables used in a query, mapping an integer index to variable names and vice versa
|
| Constructor and Description |
|---|
Query(java.util.List<VariableOrConstant<java.lang.String,T>[]> patterns,
long expirationTime)
Constructs a new query given a set of tuple patterns and an expiration time
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Query<T,S> other)
Orders queries by increasing expiration time
|
java.util.List<Query.PatternInQuery<T,S>> |
getPatterns()
Gets this query's tuple patterns
|
SolutionIndex<T> |
getSolutionIndex()
Gets the solution index stored along with this query
|
S |
getSubscription()
Get the unique ID of the query
|
Query.QueryVariables |
getVariables()
Gets this query's variables
|
boolean |
isExpired(long now)
Gets the expiration status of this query
|
void |
setExpirationTime(long expirationTime)
Sets a new expiration time for this query.
|
void |
setSubscription(S subscription)
Sets the subscription of the query.
|
public Query(java.util.List<VariableOrConstant<java.lang.String,T>[]> patterns, long expirationTime)
patterns - the graph pattern, or set of tuple patterns, which defines this queryexpirationTime - the time, in milliseconds, since the Unix epoch at which this query will automatically
become inactve and be removed from the index.
If the special value 0 is supplied as the expiration time, the query will never expire,
but may be removed explicitly.public S getSubscription()
public void setSubscription(S subscription)
subscription - the subscriptionpublic java.util.List<Query.PatternInQuery<T,S>> getPatterns()
public Query.QueryVariables getVariables()
public SolutionIndex<T> getSolutionIndex()
public boolean isExpired(long now)
now - the current time, in milliseconds since the Unix epochpublic void setExpirationTime(long expirationTime)
expirationTime - the new expiration time of this query, in milliseconds since the Unix epoch.
A special value of 0 indicates that the query should never expire.Copyright © 2016. All Rights Reserved.