com.hp.hpl.jena.graph.query
Class Bound

java.lang.Object
  extended by com.hp.hpl.jena.graph.query.Element
      extended by com.hp.hpl.jena.graph.query.Bound

public class Bound
extends Element

An element which represents an already-bound variable.


Field Summary
 
Fields inherited from class com.hp.hpl.jena.graph.query.Element
ANY
 
Constructor Summary
Bound(int n)
          Initialise a Bound element: remember n as it is the index into the Domain at which its value is stored.
 
Method Summary
 Node asNodeMatch(Domain d)
          Answer a Node suitable as a pattern-match element in a TripleMatch approximating this Element.
 boolean match(Domain d, Node x)
          Answer true iff the node x matches the previously-seen value at Donain[index].
 String toString()
           
 
Methods inherited from class com.hp.hpl.jena.graph.query.Element
getIndex
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Bound

public Bound(int n)
Initialise a Bound element: remember n as it is the index into the Domain at which its value is stored.

Method Detail

match

public boolean match(Domain d,
                     Node x)
Answer true iff the node x matches the previously-seen value at Donain[index]. The matching uses datatype-value semantics, implemented by Node::sameValueAs().

Specified by:
match in class Element
Parameters:
d - the variable bindings to read/update for variables
x - the value to match
Returns:
true if the match succeeded

asNodeMatch

public Node asNodeMatch(Domain d)
Description copied from class: Element
Answer a Node suitable as a pattern-match element in a TripleMatch approximating this Element. Thus Bind elements map to null (or Node.ANY).

Specified by:
asNodeMatch in class Element
Parameters:
d - the domain holding the variable bindings
Returns:
the matched value (null if none, ie binding occurance or ANY)

toString

public String toString()
Overrides:
toString in class Element


Licenced under the Apache License, Version 2.0