com.hp.hpl.jena.sparql.expr
Class ExprNode

java.lang.Object
  extended by com.hp.hpl.jena.sparql.expr.ExprNode
All Implemented Interfaces:
Expr
Direct Known Subclasses:
ExprAggregator, ExprFunction, ExprVar, NodeValue

public abstract class ExprNode
extends Object
implements Expr

A node that is a constraint expression that can be evaluated An Expr is already a Constraint - ExprNode is the base implementation of all Expr classes that provides the Constraint machinary.


Field Summary
 
Fields inherited from interface com.hp.hpl.jena.sparql.expr.Expr
CMP_EQUAL, CMP_GREATER, CMP_INDETERMINATE, CMP_LESS, CMP_UNEQUAL
 
Constructor Summary
ExprNode()
           
 
Method Summary
abstract  Expr applyNodeTransform(NodeTransform transform)
          Rewrite, applying a node->node transformation
 Var asVar()
          Convert to a Var variable.
 Expr copySubstitute(Binding binding)
          Deep copy with substitution
abstract  Expr copySubstitute(Binding binding, boolean foldConstants)
           
 Expr deepCopy()
          Deep copy
abstract  boolean equals(Object other)
           
abstract  NodeValue eval(Binding binding, FunctionEnv env)
          Evaluate this expression against the binding
 NodeValue getConstant()
          NodeValue constant (returns null if not a constant)
 Expr getExpr()
           
 ExprVar getExprVar()
          Variable (or null)
 ExprFunction getFunction()
          Get the function (returns null if not a function)
 Op getGraphPattern()
           
 String getVarName()
          Variable name (returns null if not a variable)
 Set<String> getVarNamesMentioned()
           
 Set<Var> getVarsMentioned()
           
abstract  int hashCode()
           
 boolean isConstant()
          Answer whether this is a constant expression - false includes "don't know" No constant folding so "false" from an expression that evaluates to a constant
 boolean isExpr()
           
 boolean isFunction()
          Answer wether this is a function.
 boolean isGraphPattern()
           
 boolean isSatisfied(Binding binding, FunctionEnv funcEnv)
          Test whether a Constraint is satisfied, given a set of bindings Includes error propagtion and Effective Boolean Value rules.
 boolean isVariable()
          Answer whether this is a variable (in which case getVarName and getNodeVar can be called)
 String toString()
           
 void varNamesMentioned(Collection<String> acc)
           
 void varsMentioned(Collection<Var> acc)
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.hp.hpl.jena.sparql.expr.Expr
visit
 

Constructor Detail

ExprNode

public ExprNode()
Method Detail

isSatisfied

public boolean isSatisfied(Binding binding,
                           FunctionEnv funcEnv)
Description copied from interface: Expr
Test whether a Constraint is satisfied, given a set of bindings Includes error propagtion and Effective Boolean Value rules.

Specified by:
isSatisfied in interface Expr
Parameters:
binding - The bindings
funcEnv - FunctionEnv
Returns:
true or false

isExpr

public boolean isExpr()

getExpr

public final Expr getExpr()

eval

public abstract NodeValue eval(Binding binding,
                               FunctionEnv env)
Description copied from interface: Expr
Evaluate this expression against the binding

Specified by:
eval in interface Expr

getVarsMentioned

public Set<Var> getVarsMentioned()
Specified by:
getVarsMentioned in interface Expr

varsMentioned

public void varsMentioned(Collection<Var> acc)
Specified by:
varsMentioned in interface Expr

getVarNamesMentioned

public Set<String> getVarNamesMentioned()

varNamesMentioned

public void varNamesMentioned(Collection<String> acc)

hashCode

public abstract int hashCode()
Overrides:
hashCode in class Object

equals

public abstract boolean equals(Object other)
Overrides:
equals in class Object

copySubstitute

public final Expr copySubstitute(Binding binding)
Description copied from interface: Expr
Deep copy with substitution

Specified by:
copySubstitute in interface Expr

deepCopy

public final Expr deepCopy()
Description copied from interface: Expr
Deep copy

Specified by:
deepCopy in interface Expr

copySubstitute

public abstract Expr copySubstitute(Binding binding,
                                    boolean foldConstants)
Specified by:
copySubstitute in interface Expr

applyNodeTransform

public abstract Expr applyNodeTransform(NodeTransform transform)
Description copied from interface: Expr
Rewrite, applying a node->node transformation

Specified by:
applyNodeTransform in interface Expr

isVariable

public boolean isVariable()
Description copied from interface: Expr
Answer whether this is a variable (in which case getVarName and getNodeVar can be called)

Specified by:
isVariable in interface Expr

getVarName

public String getVarName()
Description copied from interface: Expr
Variable name (returns null if not a variable)

Specified by:
getVarName in interface Expr

getExprVar

public ExprVar getExprVar()
Description copied from interface: Expr
Variable (or null)

Specified by:
getExprVar in interface Expr

asVar

public Var asVar()
Description copied from interface: Expr
Convert to a Var variable.

Specified by:
asVar in interface Expr

isConstant

public boolean isConstant()
Description copied from interface: Expr
Answer whether this is a constant expression - false includes "don't know" No constant folding so "false" from an expression that evaluates to a constant

Specified by:
isConstant in interface Expr

getConstant

public NodeValue getConstant()
Description copied from interface: Expr
NodeValue constant (returns null if not a constant)

Specified by:
getConstant in interface Expr

isFunction

public boolean isFunction()
Description copied from interface: Expr
Answer wether this is a function.

Specified by:
isFunction in interface Expr

getFunction

public ExprFunction getFunction()
Description copied from interface: Expr
Get the function (returns null if not a function)

Specified by:
getFunction in interface Expr

isGraphPattern

public boolean isGraphPattern()

getGraphPattern

public Op getGraphPattern()

toString

public String toString()
Overrides:
toString in class Object


Licenced under the Apache License, Version 2.0