/**
 * Copyright 2011-2013 Akiban Technologies, Inc.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/* The original from which this derives bore the following: */

/*

   Derby - Class org.apache.derby.impl.sql.compile.BinaryRelationalOperatorNode

   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to you under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

 */

package com.akiban.sql.parser;

import com.akiban.sql.StandardException;

/**
 * This class represents the 6 binary operators: LessThan, LessThanEquals,
 * Equals, NotEquals, GreaterThan and GreaterThanEquals.
 *
 */

public class BinaryRelationalOperatorNode extends BinaryComparisonOperatorNode 
{
    // TODO: Is there any point to this?

    public final int EQUALS_RELOP = 1;
    public final int NOT_EQUALS_RELOP = 2;
    public final int GREATER_THAN_RELOP = 3;
    public final int GREATER_EQUALS_RELOP = 4;
    public final int LESS_THAN_RELOP = 5;
    public final int LESS_EQUALS_RELOP = 6;
    public final int IS_NULL_RELOP = 7;
    public final int IS_NOT_NULL_RELOP = 8;

    private int operatorType;

    public void init(Object leftOperand, Object rightOperand) {
        String methodName = "";
        String operatorName = "";

        switch (getNodeType()) {
        case NodeTypes.BINARY_EQUALS_OPERATOR_NODE:
            methodName = "equals";
            operatorName = "=";
            operatorType = EQUALS_RELOP;
            break;

        case NodeTypes.BINARY_GREATER_EQUALS_OPERATOR_NODE:
            methodName = "greaterOrEquals";
            operatorName = ">=";
            operatorType = GREATER_EQUALS_RELOP;
            break;

        case NodeTypes.BINARY_GREATER_THAN_OPERATOR_NODE:
            methodName = "greaterThan";
            operatorName = ">";
            operatorType = GREATER_THAN_RELOP;
            break;

        case NodeTypes.BINARY_LESS_EQUALS_OPERATOR_NODE:
            methodName = "lessOrEquals";
            operatorName = "<=";
            operatorType =  LESS_EQUALS_RELOP;
            break;

        case NodeTypes.BINARY_LESS_THAN_OPERATOR_NODE:
            methodName = "lessThan";
            operatorName = "<";
            operatorType = LESS_THAN_RELOP;
            break;
        case NodeTypes.BINARY_NOT_EQUALS_OPERATOR_NODE:
            methodName = "notEquals";
            operatorName = "<>";
            operatorType = NOT_EQUALS_RELOP;
            break;

        default:
            assert false : "init for BinaryRelationalOperator called with wrong nodeType = " + getNodeType();
            break;
        }
        super.init(leftOperand, rightOperand, operatorName, methodName);
    }

    /**
     * Fill this node with a deep copy of the given node.
     */
    public void copyFrom(QueryTreeNode node) throws StandardException {
        super.copyFrom(node);

        BinaryRelationalOperatorNode other = (BinaryRelationalOperatorNode)node;
        this.operatorType = other.operatorType;
    }

    public int getOperatorType() {
        return operatorType;
    }

}

@@ -1902,32 +1902,39 @@
 is?%0A%0A    public 
+static 
 final int EQUALS
@@ -1948,32 +1948,39 @@
 = 1;%0A    public 
+static 
 final int NOT_EQ
@@ -1998,32 +1998,39 @@
 = 2;%0A    public 
+static 
 final int GREATE
@@ -2050,32 +2050,39 @@
 = 3;%0A    public 
+static 
 final int GREATE
@@ -2104,32 +2104,39 @@
 = 4;%0A    public 
+static 
 final int LESS_T
@@ -2153,32 +2153,39 @@
 = 5;%0A    public 
+static 
 final int LESS_E
@@ -2204,32 +2204,39 @@
 = 6;%0A    public 
+static 
 final int IS_NUL
@@ -2259,16 +2259,23 @@
  public 
+static 
 final in

Make binary relops static.