org.apache.felix.gogo.runtime

## Class Expression.Comparator

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

Enclosing class:
  Expression

    public abstract class Expression.Comparator
    extends Expression.Operator

### Constructor Summary

Constructors
Constructor and Description
`Comparator(String oper, int precedence)`

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`abstract boolean` `compare(Comparable<?> v1, Comparable<?> v2)` This method actually implements the comparison.
`BigDecimal` `eval(BigDecimal v1, BigDecimal v2)` Implementation for this operator.
`Object` `eval(String v1, String v2)`

### Methods inherited from class org.apache.felix.gogo.runtime.Expression.Operator

`eval, getOper, getPrecedence, isLeftAssoc, toString`

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

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

### Constructor Detail

#### Comparator

    public Comparator(String oper,
                      int precedence)

### Method Detail

#### eval

    public BigDecimal eval(BigDecimal v1,
                           BigDecimal v2)

Description copied from class: `Expression.Operator`
Implementation for this operator.

Specified by:
  `eval` in class `Expression.Operator`
Parameters:
  `v1` - Operand 1.
  `v2` - Operand 2.
Returns:
  The result of the operation.

#### eval

    public Object eval(String v1,
                       String v2)

Overrides:
  `eval` in class `Expression.Operator`

#### compare

    public abstract boolean compare(Comparable<?> v1,
                                    Comparable<?> v2)

This method actually implements the comparison. It will be called with either 2 BigIntegers or 2 Strings.

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