org.openanzo.glitter.expression
Class BinaryFunction

java.lang.Object
  extended by org.openanzo.glitter.expression.FunctionBase
      extended by org.openanzo.glitter.expression.BinaryFunction
All Implemented Interfaces:
Function, FunctionOnValues
Direct Known Subclasses:
BooleanEq, BooleanGe, BooleanGt, BooleanLe, BooleanLt, BooleanNe, DateTimeEq, DateTimeGe, DateTimeGt, DateTimeLe, DateTimeLt, DateTimeNe, LangMatches, NumericAdd, NumericDivide, NumericEq, NumericGe, NumericGt, NumericLe, NumericLt, NumericMultiply, NumericNe, NumericSubtract, RDFTermEq, RDFTermNe, SameTerm, StringLiteralGe, StringLiteralGt, StringLiteralLe, StringLiteralLt

public abstract class BinaryFunction
extends FunctionBase
implements FunctionOnValues

BinaryFunction is a base class for SPARQL functions that take two arguments. It checks the number of arguments supplied and defers to an abstract method call(RDFTerm, RDFTerm) that unpackages the binary arguments from the original argument list.

Author:
lee

Constructor Summary
BinaryFunction()
           
 
Method Summary
 RDFTerm call(java.util.List<RDFTerm> arguments)
          Invokes the function and determines a return value.
abstract  RDFTerm call(RDFTerm arg1, RDFTerm arg2)
          Invoke a binary function explicitly with two arguments.
 
Methods inherited from class org.openanzo.glitter.expression.FunctionBase
compareBooleans, compareBooleans, compareDateTimes, compareNumerics, compareStringLiterals, operatesOnTypeErrors, operatesOnValues
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openanzo.glitter.expression.Function
getIdentifier, operatesOnTypeErrors, operatesOnValues
 

Constructor Detail

BinaryFunction

public BinaryFunction()
Method Detail

call

public RDFTerm call(java.util.List<RDFTerm> arguments)
             throws ExpressionEvaluationException
Description copied from interface: FunctionOnValues
Invokes the function and determines a return value.

Specified by:
call in interface FunctionOnValues
Parameters:
arguments - The (evaluated) RDF terms being passed to the function
Returns:
The result of evaluating this function against the given arguments
Throws:
ExpressionEvaluationException - For invalid types, or other expression evalutaion problems

call

public abstract RDFTerm call(RDFTerm arg1,
                             RDFTerm arg2)
                      throws ExpressionEvaluationException
Invoke a binary function explicitly with two arguments. Subclasses need only implement this method and are assured that they will receive exactly two arguments.

Parameters:
arg1 - First argument to the function
arg2 - Second argument to the function
Returns:
The return value of the function
Throws:
ExpressionEvaluationException


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