Class Operators
java.lang.Object
weka.core.expressionlanguage.common.Operators
A class to specify the semantics of operators in the expressionlanguage
To move the operator semantics outside the parser they are specified
here. The parser can then call these methods so that operators can be
resolved to AST (abstract syntax tree) nodes.
- Version:
- $Revision: 1000 $
- Author:
- Benjamin Weber ( benweber at student dot ethz dot ch )
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Primitives.BooleanExpression
'&
' or 'and
' logical and operatorstatic Node
'/
' division operatorstatic Primitives.BooleanExpression
'=
' equal operatorstatic Primitives.BooleanExpression
greaterEqual
(Node left, Node right) '>=
' greater equal operatorstatic Primitives.BooleanExpression
greaterThan
(Node left, Node right) '>
' greater than operatorstatic Primitives.BooleanExpression
'is
' is operator (to check for string equality)static Primitives.BooleanExpression
'<=
' less equal operatorstatic Primitives.BooleanExpression
'<
' less than operatorstatic Node
'-
' minus operatorstatic Primitives.BooleanExpression
'!
' or 'not
' logical not operatorstatic Primitives.BooleanExpression
'|
' or 'or
' logical or operatorstatic Node
'+
' plus operatorstatic Node
'^
' power operatorstatic Primitives.BooleanExpression
'regexp
' regexp operator (to check for string matching a given regular expression)static Node
'*
' times operatorstatic Node
'-
' unary minus operatorstatic Node
'+
' unary plus operator
-
Constructor Details
-
Operators
public Operators()
-
-
Method Details
-
plus
'+
' plus operator- Throws:
SemanticException
-
minus
'-
' minus operator- Throws:
SemanticException
-
times
'*
' times operator- Throws:
SemanticException
-
division
'/
' division operator- Throws:
SemanticException
-
uplus
'+
' unary plus operator- Throws:
SemanticException
-
uminus
'-
' unary minus operator- Throws:
SemanticException
-
pow
'^
' power operator- Throws:
SemanticException
-
lessThan
'<
' less than operator- Throws:
SemanticException
-
lessEqual
public static Primitives.BooleanExpression lessEqual(Node left, Node right) throws SemanticException '<=
' less equal operator- Throws:
SemanticException
-
greaterThan
public static Primitives.BooleanExpression greaterThan(Node left, Node right) throws SemanticException '>
' greater than operator- Throws:
SemanticException
-
greaterEqual
public static Primitives.BooleanExpression greaterEqual(Node left, Node right) throws SemanticException '>=
' greater equal operator- Throws:
SemanticException
-
equal
'=
' equal operator- Throws:
SemanticException
-
not
'!
' or 'not
' logical not operator- Throws:
SemanticException
-
and
'&
' or 'and
' logical and operator- Throws:
SemanticException
-
or
'|
' or 'or
' logical or operator- Throws:
SemanticException
-
is
'is
' is operator (to check for string equality)- Throws:
SemanticException
-
regexp
'regexp
' regexp operator (to check for string matching a given regular expression)- Throws:
SemanticException
-