org.apache.felix.gogo.runtime

## Class Expression.Operator

- java.lang.Object
- - org.apache.felix.gogo.runtime.Expression.Operator

Direct Known Subclasses:
  Expression.Assignment, Expression.Comparator

Enclosing class:
  Expression

    public abstract class Expression.Operator
    extends Object

Abstract definition of a supported operator. An operator is defined by its name (pattern), precedence and if it is left- or right associative.

### Constructor Summary

Constructors
Constructor and Description
`Operator(String oper, int precedence, boolean leftAssoc)` Creates a new operator.

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`abstract BigDecimal` `eval(BigDecimal v1, BigDecimal v2)` Implementation for this operator.
`Object` `eval(Map<String,Object> variables, Object v1, Object v2)`
`Object` `eval(String v1, String v2)`
`String` `getOper()`
`int` `getPrecedence()`
`boolean` `isLeftAssoc()`
`String` `toString()`

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

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### Operator

    public Operator(String oper,
                    int precedence,
                    boolean leftAssoc)

Creates a new operator.

Parameters:
  `oper` - The operator name (pattern).
  `precedence` - The operators precedence.
  `leftAssoc` - `true` if the operator is left associative, else `false`.

### Method Detail

#### getOper

    public String getOper()

#### getPrecedence

    public int getPrecedence()

#### isLeftAssoc

    public boolean isLeftAssoc()

#### eval

    public Object eval(Map<String,Object> variables,
                       Object v1,
                       Object v2)

#### eval

    public Object eval(String v1,
                       String v2)

#### eval

    public abstract BigDecimal eval(BigDecimal v1,
                                    BigDecimal v2)

Implementation for this operator.

Parameters:
  `v1` - Operand 1.
  `v2` - Operand 2.
Returns:
  The result of the operation.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`