/* * SPDX-FileCopyrightText: 2021-2023 The Refinery Authors * * SPDX-License-Identifier: EPL-2.0 */ package tools.refinery.store.query.term.real; import tools.refinery.store.query.substitution.Substitution; import tools.refinery.store.query.term.Term; public class RealDivTerm extends RealBinaryTerm { public RealDivTerm(Term left, Term right) { super(left, right); } @Override public Term doSubstitute(Substitution substitution, Term substitutedLeft, Term substitutedRight) { return new RealDivTerm(substitutedLeft, substitutedRight); } @Override protected Double doEvaluate(Double leftValue, Double rightValue) { return leftValue / rightValue; } @Override public String toString() { return "(%s / %s)".formatted(getLeft(), getRight()); } }