io.deephaven.engine.table.impl.updateby.minmax.ComparableCumMinMaxOperator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of deephaven-engine-table Show documentation
Show all versions of deephaven-engine-table Show documentation
Engine Table: Implementation and closely-coupled utilities
package io.deephaven.engine.table.impl.updateby.minmax;
import io.deephaven.engine.table.impl.MatchPair;
import io.deephaven.engine.table.impl.updateby.UpdateByOperator;
import io.deephaven.engine.table.impl.updateby.internal.BaseObjectBinaryOperator;
import org.jetbrains.annotations.NotNull;
public final class ComparableCumMinMaxOperator> extends BaseObjectBinaryOperator {
private final boolean isMax;
public ComparableCumMinMaxOperator(@NotNull final MatchPair inputPair,
final boolean isMax,
final Class colType) {
super(inputPair, new String[] {inputPair.rightColumn}, colType);
this.isMax = isMax;
}
@Override
public UpdateByOperator copy() {
return new ComparableCumMinMaxOperator<>(pair, isMax, colType);
}
@Override
protected T doOperation(T bucketCurVal, T chunkCurVal) {
if ((isMax && chunkCurVal.compareTo(bucketCurVal) > 0) ||
(!isMax && chunkCurVal.compareTo(bucketCurVal) < 0)) {
return chunkCurVal;
}
return bucketCurVal;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy