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

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

public class Bind
extends Element

A binding instance of a variable. It accepts any node and records it in the supplied Domain at the index allocated to it when it is created.

Author:
hedgehog

Field Summary
 
Fields inherited from class com.hp.hpl.jena.graph.query.Element
ANY
 
Constructor Summary
Bind(int n)
          Initialise a Bind element: remember the index n which is the place in Domain's where it may store its value.
 
Method Summary
 Node asNodeMatch(Domain d)
          Answer Node.ANY, as a binding occurance of a variable can match anything.
 boolean match(Domain d, Node x)
          Answer true after updating the domain to record the value this element binds.
 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

Bind

public Bind(int n)
Initialise a Bind element: remember the index n which is the place in Domain's where it may store its value.

Method Detail

match

public boolean match(Domain d,
                     Node x)
Answer true after updating the domain to record the value this element binds.

Specified by:
match in class Element
Parameters:
d - the domain in which to note this element is bound to x.
x - the value to match
Returns:
true [after side-effecting d]

asNodeMatch

public Node asNodeMatch(Domain d)
Answer Node.ANY, as a binding occurance of a variable can match anything.

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