|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.hp.hpl.jena.graph.query.QueryNode
public abstract class QueryNode
A QueryNode is a wrapped node that has been processed against some variable-binding map to discover (a) what kind of node it is and (b) what index in the binding map it has.
There are five sub-classes of QueryNode
Nested Class Summary | |
---|---|
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. |
Field Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int NO_INDEX
public final Node node
public final int index
public static final QueryNodeFactory factory
Method Detail |
---|
public String toString()
toString
in class Object
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |