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.

Author:
hedgehog

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].
 java.lang.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 java.lang.String toString()
Overrides:
toString in class Element


Copyright © 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP