public abstract class QueryNode extends Object
There are five sub-classes of QueryNode
Modifier and Type | Class and Description |
---|---|
static class |
QueryNode.Any |
static class |
QueryNode.Bind |
static class |
QueryNode.Bound |
static class |
QueryNode.Fixed |
static class |
QueryNode.JustBound |
class |
QueryNode.MustNotMatchException
Internal exception to throw if, against all chance, something that
shouldn't be involved in a match is.
|
Modifier and Type | Field and Description |
---|---|
static QueryNodeFactory |
factory |
int |
index
The index value allocated to this query node; NO_INDEX except for a
variable node, in which case it is the allocated index in the domain
object.
|
static int |
NO_INDEX
Fake index value to use when no index makes sense; we choose a value
that will fail any array-bound check if it happens to be used anyway.
|
Node |
node
The Node value on which this QueryNode is based.
|
Modifier and Type | Method and Description |
---|---|
static QueryNode |
classify(QueryNodeFactory f,
Mapping map,
Set<Node> recent,
Node n)
Answer a QueryNode that classifies the argument node
n . |
Node |
finder(Domain d)
Answer a Node value to use when this QueryValue is used to select
objects in a Graph::find() operation; for concrete nodes, that very
node, for variables their current value (ANY if not bound).
|
boolean |
isFrozen()
Answer true iff this node is "frozen", ie its value is fixed, when it
is encountered; that is, it is not a Bind or JustBound node.
|
boolean |
match(Domain d,
Node x)
Answer true iff this QueryNode matches, in the context of the binding
Domain
d , the node x . |
abstract boolean |
matchOrBind(Domain d,
Node x)
Optimisation: the action to be performed when matching a just-bound
variable or binding a newly-bound variable, or nothing for any other
kind of QueryNode.
|
boolean |
mustMatch()
Answer true iff this QueryNode must be used in a triple-match of its
owning QueryTriple.
|
String |
toString()
Return a handy string representation for debugging purposes.
|
public static final int NO_INDEX
public final Node node
public final int index
public static final QueryNodeFactory factory
public String toString()
public boolean isFrozen()
public Node finder(Domain d)
public boolean mustMatch()
public boolean match(Domain d, Node x)
d
, the node x
.public abstract boolean matchOrBind(Domain d, Node x)
public static QueryNode classify(QueryNodeFactory f, Mapping map, Set<Node> recent, Node n)
n
.
The factory f
is used to create the different QueryNodes,
allowing different classifiers to use their own subclasses of QueryNode
if they wish. map
is the variable-to-index map, and
recent
is the set of those variables "just" bound, ie,
earlier in the same triple.Copyright ? 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP