aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/zwobble/couscous/ast/Operator.java
blob: a2151388b66c3aa2ff3a919f0824cde4f6110324 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package org.zwobble.couscous.ast;

public enum Operator {
    BOOLEAN_AND("and", true),
    BOOLEAN_OR("or", true),

    ADD("add", false),
    SUBTRACT("subtract", false),
    MULTIPLY("multiply", false),
    DIVIDE("divide", false),
    MOD("mod", false),

    EQUALS("equals", true),
    NOT_EQUALS("notEquals", true),
    GREATER_THAN("greaterThan", true),
    GREATER_THAN_OR_EQUAL("greaterThanOrEqual", true),
    LESS_THAN("lessThan", true),
    LESS_THAN_OR_EQUAL("lessThanOrEqual", true);

    private final String methodName;
    private final boolean isBoolean;

    Operator(String methodName, boolean isBoolean) {
        this.methodName = methodName;
        this.isBoolean = isBoolean;
    }

    public String getMethodName() {
        return methodName;
    }

    public boolean isBoolean() {
        return isBoolean;
    }
}