org.openrdf.sesame.sail.query
Class MathExpr

java.lang.Object
  extended byorg.openrdf.sesame.sail.query.MathExpr
All Implemented Interfaces:
StringExpr, ValueExpr

public class MathExpr
extends Object
implements ValueExpr

A mathematical expression consisting an operator and two arguments.


Field Summary
static int DIVIDE
          The division (/) operator.
static int MULTIPLY
          The multiplication (*) operator.
static int PLUS
          The plus (+) operator.
static int REMAINDER
          The remainder (%) operator.
static int SUBTRACT
          The subtraction (-) operator.
 
Constructor Summary
MathExpr(ValueExpr leftArg, ValueExpr rightArg, int op)
           
 
Method Summary
 ValueExpr getLeftArg()
           
 int getOperator()
           
 ValueExpr getRightArg()
           
 String getString()
          Gets the String value for this expression.
 Value getValue()
          Gets the value of this expression.
static Literal getValue(Literal leftLit, Literal rightLit, int op)
           
 void getVariables(Collection variables)
          Gets all variables that are used in this StringExpr.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PLUS

public static final int PLUS
The plus (+) operator.

See Also:
Constant Field Values

SUBTRACT

public static final int SUBTRACT
The subtraction (-) operator.

See Also:
Constant Field Values

MULTIPLY

public static final int MULTIPLY
The multiplication (*) operator.

See Also:
Constant Field Values

DIVIDE

public static final int DIVIDE
The division (/) operator.

See Also:
Constant Field Values

REMAINDER

public static final int REMAINDER
The remainder (%) operator.

See Also:
Constant Field Values
Constructor Detail

MathExpr

public MathExpr(ValueExpr leftArg,
                ValueExpr rightArg,
                int op)
Method Detail

getLeftArg

public ValueExpr getLeftArg()

getRightArg

public ValueExpr getRightArg()

getOperator

public int getOperator()

getVariables

public void getVariables(Collection variables)
Description copied from interface: StringExpr
Gets all variables that are used in this StringExpr.

Specified by:
getVariables in interface StringExpr
Parameters:
variables - a Collection to add relevant Var objects to.

getString

public String getString()
Description copied from interface: StringExpr
Gets the String value for this expression.

Specified by:
getString in interface StringExpr

getValue

public Value getValue()
Description copied from interface: ValueExpr
Gets the value of this expression.

Specified by:
getValue in interface ValueExpr

getValue

public static Literal getValue(Literal leftLit,
                               Literal rightLit,
                               int op)

toString

public String toString()


Copyright © 2002-2006 Aduna BV, GNU LGPL License applies.