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

com.jaregu.database.queries.compiling.expr.UnaryOperand Maven / Gradle / Ivy

Go to download

Java based SQL templating project. Store your queries in *.sql files and build queries for execution. Supports simple expressions and conditional clauses and interface proxying for java-sql bridge.

There is a newer version: 1.4.1
Show newest version
package com.jaregu.database.queries.compiling.expr;

import java.util.List;

public final class UnaryOperand extends EvaluableOperand implements Operand {

	private Operator operator;
	private Operand operand;

	public UnaryOperand(Operator operator, Operand operand) {
		if (!operator.isUnary()) {
			throw new IllegalArgumentException("Operator: " + operator + " is no unary!");
		}
		this.operator = operator;
		this.operand = operand;
	}

	@Override
	public Object getValue() {
		return operator.getUnary().apply(operand);
	}

	@Override
	public List getVariableNames() {
		return operand.getVariableNames();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy