Package 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
Description
`Operator(String oper, int precedence, boolean leftAssoc)`
Creates a new operator.

## Method Summary

Modifier and Type
Method
Description
`Object`
`eval(String v1, String v2)`
`abstract BigDecimal`
`eval(BigDecimal v1, BigDecimal v2)`
Implementation for this operator.
`Object`
`eval(Map<String,Object> variables, Object v1, Object 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 Details

### 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 Details

### 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`