org.openanzo.glitter.query.rewriter
Class VariableRewriter

java.lang.Object
  extended by org.openanzo.glitter.query.rewriter.VariableRewriter
All Implemented Interfaces:
TreeRewriter

public class VariableRewriter
extends java.lang.Object
implements TreeRewriter

The VariableRewriter rewrites a triple pattern that contains a variable which is bound to only a single value in the supplied bindings.

Author:
lee

Constructor Summary
VariableRewriter(java.util.Map<Bindable,RDFTerm> bindings)
          Constructor.
 
Method Summary
 TreeNode rewriteTreeNode(TreeNode node)
          Rewrites the given node from a SPARQL abstract syntax tree.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VariableRewriter

public VariableRewriter(java.util.Map<Bindable,RDFTerm> bindings)
Constructor.

Parameters:
bindings - Current bindings.
Method Detail

rewriteTreeNode

public TreeNode rewriteTreeNode(TreeNode node)
Description copied from interface: TreeRewriter
Rewrites the given node from a SPARQL abstract syntax tree.

Specified by:
rewriteTreeNode in interface TreeRewriter
Parameters:
node - the node in question
Returns:
A tree node to replace the passed in tree node. Returning node leaves this spot in the AST unchanged. Returning null removes this node from the tree. (Note that it is possible that removing the node will leave the tree in an invalid state. Behavior in this case is undefined.)


Copyright © 2007 Cambridge Semantics Inc.. All Rights Reserved.