com.samskivert.depot.impl.operator.Add Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of depot Show documentation
Show all versions of depot Show documentation
A library for relational-database-based persistence in Java.
The newest version!
//
// Depot library - a Java relational persistence library
// https://github.com/threerings/depot/blob/master/LICENSE
package com.samskivert.depot.impl.operator;
import com.samskivert.depot.expression.SQLExpression;
/**
* The SQL '+' operator.
*/
public class Add extends Arithmetic
{
public Add (SQLExpression> column, T value)
{
super(column, value);
}
public Add (SQLExpression>... values)
{
super(values);
}
@Override // from Arithmetic
public String operator()
{
return "+";
}
@Override // from Arithmetic
public Object evaluate (Object[] operands)
{
return evaluate(operands, "+", new Accumulator() {
public Double accumulate (Double left, Double right) {
return left + right;
}
}, new Accumulator() {
public Long accumulate (Long left, Long right) {
return left + right;
}
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy