All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.joo.libra.sql.node.NumericCompareExpressionNode Maven / Gradle / Ivy

There is a newer version: 2.1.2
Show newest version
package org.joo.libra.sql.node;

import org.joo.libra.Predicate;
import org.joo.libra.common.HasValue;
import org.joo.libra.numeric.GreaterEqualPredicate;
import org.joo.libra.numeric.GreaterPredicate;
import org.joo.libra.numeric.LessEqualPredicate;
import org.joo.libra.numeric.LessPredicate;
import org.joo.libra.sql.antlr.SqlLexer;

public class NumericCompareExpressionNode extends AbstractBinaryOpExpressionNode> {

	@Override
	public Predicate buildPredicate() {
		switch (getOp()) {
		case SqlLexer.GREATER_THAN:
			return new GreaterPredicate(getLeft(), getRight());
		case SqlLexer.GREATER_THAN_EQUALS:
			return new GreaterEqualPredicate(getLeft(), getRight());
		case SqlLexer.LESS_THAN:
			return new LessPredicate(getLeft(), getRight());
		case SqlLexer.LESS_THAN_EQUALS:
			return new LessEqualPredicate(getLeft(), getRight());
		default:
			return null;
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy