org.openanzo.glitter.syntax.abstrakt
Class FunctionCall

java.lang.Object
  extended by org.openanzo.glitter.syntax.abstrakt.Expression
      extended by org.openanzo.glitter.syntax.abstrakt.FunctionCall

public class FunctionCall
extends Expression

A FunctionCall is an Expression that represents the invocation of a particular Function against a list of arguments.

Author:
lee

Constructor Summary
FunctionCall(java.lang.Class<Function> functionClass, java.util.List<Expression> arguments)
          Construct a FunctionCall from a Function (class) and a list of arguments.
FunctionCall(Function f, java.util.List<Expression> arguments)
          Construct a FunctionCall from a Function and a list of arguemnts.
FunctionCall(java.lang.String functionClassName, java.util.List<Expression> arguments)
          Construct a FunctionCall from the name of a Function and a list of arguments.
FunctionCall(java.net.URI u, java.util.List<Expression> arguments)
          Construct a FunctionCall from the name of a function (as a URI) and a list of arguments.
 
Method Summary
 RDFTerm evaluate(PatternSolution environment)
           
 java.util.List<Expression> getArguments()
           
 Function getFunction()
           
 java.util.Set<Variable> getReferencedVariables()
           
 boolean replaceArgument(Expression oldArgument, Expression newArgument)
          Replaces one argument to this function with another.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FunctionCall

public FunctionCall(java.lang.String functionClassName,
                    java.util.List<Expression> arguments)
             throws java.lang.ClassNotFoundException,
                    java.lang.IllegalAccessException,
                    java.lang.InstantiationException
Construct a FunctionCall from the name of a Function and a list of arguments.

Parameters:
functionClassName -
arguments -
Throws:
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.InstantiationException

FunctionCall

public FunctionCall(java.lang.Class<Function> functionClass,
                    java.util.List<Expression> arguments)
             throws java.lang.IllegalAccessException,
                    java.lang.InstantiationException
Construct a FunctionCall from a Function (class) and a list of arguments.

Parameters:
functionClass -
arguments -
Throws:
java.lang.IllegalAccessException
java.lang.InstantiationException

FunctionCall

public FunctionCall(Function f,
                    java.util.List<Expression> arguments)
Construct a FunctionCall from a Function and a list of arguemnts.

Parameters:
f -
arguments -

FunctionCall

public FunctionCall(java.net.URI u,
                    java.util.List<Expression> arguments)
             throws UnknownFunctionException
Construct a FunctionCall from the name of a function (as a URI) and a list of arguments. Finds the Function in the static FunctionRegistry.

Parameters:
u -
arguments -
Throws:
UnknownFunctionException
Method Detail

evaluate

public RDFTerm evaluate(PatternSolution environment)
                 throws ExpressionEvaluationException
Specified by:
evaluate in class Expression
Parameters:
environment - A set of bindings to use to evaluate Bindable objects in the expression.
Returns:
The RDFTerm that is the value of evaluating this expression.
Throws:
ExpressionEvaluationException - If there is an error (e.g. a type error) in evaluating this expression.

replaceArgument

public boolean replaceArgument(Expression oldArgument,
                               Expression newArgument)
Replaces one argument to this function with another. (Can be used to do, for example, constant folding.)

Parameters:
oldArgument -
newArgument -
Returns:
return true if argument was replaced

getReferencedVariables

public java.util.Set<Variable> getReferencedVariables()
Specified by:
getReferencedVariables in class Expression
Returns:
A set of all the variables that occur in this expression.

getFunction

public Function getFunction()
Returns:
the function

getArguments

public java.util.List<Expression> getArguments()
Returns:
The list of arguments to this function call.


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