Class Operators
- java.lang.Object
-
- weka.core.expressionlanguage.common.Operators
-
public class Operators extends java.lang.ObjectA 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
Constructors Constructor Description Operators()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Primitives.BooleanExpressionand(Node left, Node right)'&' or 'and' logical and operatorstatic Nodedivision(Node left, Node right)'/' division operatorstatic Primitives.BooleanExpressionequal(Node left, Node right)'=' equal operatorstatic Primitives.BooleanExpressiongreaterEqual(Node left, Node right)'>=' greater equal operatorstatic Primitives.BooleanExpressiongreaterThan(Node left, Node right)'>' greater than operatorstatic Primitives.BooleanExpressionis(Node left, Node right)'is' is operator (to check for string equality)static Primitives.BooleanExpressionlessEqual(Node left, Node right)'<=' less equal operatorstatic Primitives.BooleanExpressionlessThan(Node left, Node right)'<' less than operatorstatic Nodeminus(Node left, Node right)'-' minus operatorstatic Primitives.BooleanExpressionnot(Node expr)'!' or 'not' logical not operatorstatic Primitives.BooleanExpressionor(Node left, Node right)'|' or 'or' logical or operatorstatic Nodeplus(Node left, Node right)'+' plus operatorstatic Nodepow(Node left, Node right)'^' power operatorstatic Primitives.BooleanExpressionregexp(Node left, Node right)'regexp' regexp operator (to check for string matching a given regular expression)static Nodetimes(Node left, Node right)'*' times operatorstatic Nodeuminus(Node expr)'-' unary minus operatorstatic Nodeuplus(Node expr)'+' unary plus operator
-
-
-
Method Detail
-
plus
public static Node plus(Node left, Node right) throws SemanticException
'+' plus operator- Throws:
SemanticException
-
minus
public static Node minus(Node left, Node right) throws SemanticException
'-' minus operator- Throws:
SemanticException
-
times
public static Node times(Node left, Node right) throws SemanticException
'*' times operator- Throws:
SemanticException
-
division
public static Node division(Node left, Node right) throws SemanticException
'/' division operator- Throws:
SemanticException
-
uplus
public static Node uplus(Node expr) throws SemanticException
'+' unary plus operator- Throws:
SemanticException
-
uminus
public static Node uminus(Node expr) throws SemanticException
'-' unary minus operator- Throws:
SemanticException
-
pow
public static Node pow(Node left, Node right) throws SemanticException
'^' power operator- Throws:
SemanticException
-
lessThan
public static Primitives.BooleanExpression lessThan(Node left, Node right) throws SemanticException
'<' 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
public static Primitives.BooleanExpression equal(Node left, Node right) throws SemanticException
'=' equal operator- Throws:
SemanticException
-
not
public static Primitives.BooleanExpression not(Node expr) throws SemanticException
'!' or 'not' logical not operator- Throws:
SemanticException
-
and
public static Primitives.BooleanExpression and(Node left, Node right) throws SemanticException
'&' or 'and' logical and operator- Throws:
SemanticException
-
or
public static Primitives.BooleanExpression or(Node left, Node right) throws SemanticException
'|' or 'or' logical or operator- Throws:
SemanticException
-
is
public static Primitives.BooleanExpression is(Node left, Node right) throws SemanticException
'is' is operator (to check for string equality)- Throws:
SemanticException
-
regexp
public static Primitives.BooleanExpression regexp(Node left, Node right) throws SemanticException
'regexp' regexp operator (to check for string matching a given regular expression)- Throws:
SemanticException
-
-