![JAR search and dependency download from the Maven repository](/logo.png)
org.dflib.exp.Condition2 Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dflib Show documentation
Show all versions of dflib Show documentation
dflib: DataFrame library
package org.dflib.exp;
import org.dflib.BooleanSeries;
import org.dflib.Condition;
import org.dflib.DataFrame;
import org.dflib.Exp;
import org.dflib.Series;
/**
* @since 0.11
*/
public abstract class Condition2 implements Condition {
private final String opName;
protected final Exp left;
protected final Exp right;
public Condition2(String opName, Exp left, Exp right) {
this.opName = opName;
this.left = left;
this.right = right;
}
@Override
public String toString() {
return toQL();
}
// TODO: space between the operand and arguments
public String toQL() {
return left.toQL() + opName + right.toQL();
}
@Override
public String toQL(DataFrame df) {
return left.toQL(df) + opName + right.toQL(df);
}
@Override
public BooleanSeries eval(DataFrame df) {
return doEval(left.eval(df), right.eval(df));
}
@Override
public BooleanSeries eval(Series> s) {
return doEval(left.eval(s), right.eval(s));
}
protected abstract BooleanSeries doEval(Series left, Series right);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy