first commit

This commit is contained in:
me
2026-04-08 21:25:17 +03:00
parent 3681b8eccd
commit 371b14c5e3
173 changed files with 14126 additions and 0 deletions

41
java/expression/Low.java Normal file
View File

@@ -0,0 +1,41 @@
package expression;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.List;
/**
* @author Doschennikov Nikita (me@fymio.us)
*/
public class Low extends AbstractExpression {
private final AbstractExpression operand;
public Low(AbstractExpression operand) {
this.operand = operand;
}
@Override public int evaluate(int x) { int n = operand.evaluate(x); return n & -n; }
@Override public int evaluate(int x, int y, int z) { int n = operand.evaluate(x,y,z); return n & -n; }
@Override public int evaluate(List<Integer> vars) { int n = operand.evaluate(vars); return n & -n; }
@Override public BigInteger evaluateBi(List<BigInteger> vars) { throw new UnsupportedOperationException(); }
@Override public BigDecimal evaluateBd(List<BigDecimal> vars) { throw new UnsupportedOperationException(); }
@Override public String toString() { return "low(" + operand + ")"; }
@Override
public String toMiniString() {
if (operand instanceof AbstractBinaryOperation) {
return "low(" + operand.toMiniString() + ")";
}
return "low " + operand.toMiniString();
}
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (!(obj instanceof Low)) return false;
return operand.equals(((Low) obj).operand);
}
@Override public int hashCode() { return operand.hashCode() ^ 0x4C4F5700; }
}