Package weka.core.expressionlanguage.common

# Class Operators

java.lang.Object
weka.core.expressionlanguage.common.Operators

public class Operators extends Object
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

  Constructors
  Constructor
  Description
  `Operators()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static Primitives.BooleanExpression`
  `and(Node left, Node right)`
  '`&`' or '`and`' logical and operator
  `static Node`
  `division(Node left, Node right)`
  '`/`' division operator
  `static Primitives.BooleanExpression`
  `equal(Node left, Node right)`
  '`=`' equal operator
  `static Primitives.BooleanExpression`
  `greaterEqual(Node left, Node right)`
  '`>=`' greater equal operator
  `static Primitives.BooleanExpression`
  `greaterThan(Node left, Node right)`
  '`>`' greater than operator
  `static Primitives.BooleanExpression`
  `is(Node left, Node right)`
  '`is`' is operator (to check for string equality)
  `static Primitives.BooleanExpression`
  `lessEqual(Node left, Node right)`
  '`&lt=`' less equal operator
  `static Primitives.BooleanExpression`
  `lessThan(Node left, Node right)`
  '`<`' less than operator
  `static Node`
  `minus(Node left, Node right)`
  '`-`' minus operator
  `static Primitives.BooleanExpression`
  `not(Node expr)`
  '`!`' or '`not`' logical not operator
  `static Primitives.BooleanExpression`
  `or(Node left, Node right)`
  '`|`' or '`or`' logical or operator
  `static Node`
  `plus(Node left, Node right)`
  '`+`' plus operator
  `static Node`
  `pow(Node left, Node right)`
  '`^`' power operator
  `static Primitives.BooleanExpression`
  `regexp(Node left, Node right)`
  '`regexp`' regexp operator (to check for string matching a given regular expression)
  `static Node`
  `times(Node left, Node right)`
  '`*`' times operator
  `static Node`
  `uminus(Node expr)`
  '`-`' unary minus operator
  `static Node`
  `uplus(Node expr)`
  '`+`' unary plus operator

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### Operators

    public Operators()

- ## Method Details

  - ### 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
    '`&lt=`' 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`