Package org.eclipse.birt.report.model.api.util

# Class OperatorUtil

java.lang.Object
org.eclipse.birt.report.model.api.util.OperatorUtil

public class OperatorUtil extends Object
Represents the utility class to help compute level of operator.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`OPERATOR_LEVEL_NOT_EXIST`
If operator is not in the choice list, then level is fail.
`static final int`
`OPERATOR_LEVEL_ONE`
If operater is >, >= , = , invalid input: '<' , invalid input: '<'= , like , top , bottom , any , then level is one.
`static final int`
`OPERATOR_LEVEL_TWO`
If operater is between , not between , then level is two.
`static final int`
`OPERATOR_LEVEL_ZERO`
If operater is null, not null, true , false , then level is zero.

## Constructor Summary

Constructors
Constructor
Description
`OperatorUtil()`

## Method Summary

Modifier and Type
Method
Description
`static int`
`computeFilterOperatorLevel(String operator)`
Computes the level of operator.
`static int`
`computeStyleRuleOperatorLevel(String operator)`
Computes the level of operator.

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

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

## Field Details

### OPERATOR_LEVEL_ZERO

public static final int OPERATOR_LEVEL_ZERO
If operater is null, not null, true , false , then level is zero. Delete value1 and value2 in design file

See Also:
  - Constant Field Values

### OPERATOR_LEVEL_ONE

public static final int OPERATOR_LEVEL_ONE
If operater is >, >= , = , invalid input: '<' , invalid input: '<'= , like , top , bottom , any , then level is one. Set value1, delete value2 in design file

See Also:
  - Constant Field Values

### OPERATOR_LEVEL_TWO

public static final int OPERATOR_LEVEL_TWO
If operater is between , not between , then level is two. Set value1 and value2 in design file.

See Also:
  - Constant Field Values

### OPERATOR_LEVEL_NOT_EXIST

public static final int OPERATOR_LEVEL_NOT_EXIST
If operator is not in the choice list, then level is fail.

See Also:
  - Constant Field Values

## Constructor Details

### OperatorUtil

public OperatorUtil()

## Method Details

### computeStyleRuleOperatorLevel

public static int computeStyleRuleOperatorLevel(String operator)
Computes the level of operator. The allowed values are defined in `DesignChoiceConstants`, If operator is one of follows:

- `MAP_OPERATOR_NULL`
- `MAP_OPERATOR_NOT_NULL`
- `MAP_OPERATOR_TRUE`
- `MAP_OPERATOR_FALSE`

return `OPERATOR_LEVEL_ZERO`; If operator is one of follows:

- `MAP_OPERATOR_EQ`
- `MAP_OPERATOR_NE`
- `MAP_OPERATOR_LT`
- `MAP_OPERATOR_LE`
- `MAP_OPERATOR_GE`
- `MAP_OPERATOR_GT`
- `MAP_OPERATOR_LIKE`
- `MAP_OPERATOR_TOP_N`
- `MAP_OPERATOR_BOTTOM_N`
- `MAP_OPERATOR_NOT_LIKE`
- `MAP_OPERATOR_NOT_MATCH`
- `MAP_OPERATOR_ANY`

return `OPERATOR_LEVEL_ONE`; If operator is one of follows:

- `MAP_OPERATOR_BETWEEN`
- `MAP_OPERATOR_NOT_BETWEEN`

return `OPERATOR_LEVEL_TWO`; If operator is not in the choice list, return `OPERATOR_LEVEL_NOT_EXIST`.````````

Parameters:
  `operator` - the operator to compute.
Returns:
  level of operator.

### computeFilterOperatorLevel

public static int computeFilterOperatorLevel(String operator)
Computes the level of operator. The allowed values are defined in `DesignChoiceConstants`, If operator is one of follows:

- `FILTER_OPERATOR_NULL`
- `FILTER_OPERATOR_NOT_NULL`
- `FILTER_OPERATOR_TRUE`
- `FILTER_OPERATOR_FALSE`

return `OPERATOR_LEVEL_ZERO`; If operator is one of follows:

- `FILTER_OPERATOR_EQ`
- `FILTER_OPERATOR_NE`
- `FILTER_OPERATOR_LT`
- `FILTER_OPERATOR_LE`
- `FILTER_OPERATOR_GE`
- `FILTER_OPERATOR_GT`
- `FILTER_OPERATOR_LIKE`
- `FILTER_OPERATOR_TOP_N`
- `FILTER_OPERATOR_BOTTOM_N`
- `FILTER_OPERATOR_TOP_PERCENT`
- `FILTER_OPERATOR_BOTTOM_PERCENT`
- `FILTER_OPERATOR_ANY`

return `OPERATOR_LEVEL_ONE`; If operator is one of follows:

- `FILTER_OPERATOR_BETWEEN`
- `FILTER_OPERATOR_NOT_BETWEEN`

return `OPERATOR_LEVEL_TWO`; If operator is not in the choice list, return `OPERATOR_LEVEL_NOT_EXIST`.````````

Parameters:
  `operator` - the operator to compute.
Returns:
  level of operator.