money.rave.common.backend.expression.operator.unary.Max.kt Maven / Gradle / Ivy
package money.rave.common.backend.expression
import money.rave.common.backend.expression.EvaluationContext
import money.rave.common.backend.expression.Expression
import java.math.BigDecimal
class Max(
child: Expression,
private val candleCount: Int,
private val defaultCandleIndex: Int = 0,
) : UnaryOperator(child) {
override fun evaluate(context: EvaluationContext, candleIndex: Int): BigDecimal = (0 until candleCount).maxOf { child.evaluate(context, defaultCandleIndex + candleIndex + it) }
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy