public static Expr unary(UnaryOperation op, OperationType type, Expr arg) { UnaryExpr expr = new UnaryExpr(); expr.setOperand(arg); expr.setOperation(op); expr.setType(type); return expr; }
@Override protected Expr clone(Map<Expr, Expr> cache) { Expr known = cache.get(this); if (known != null) { return known; } UnaryExpr copy = new UnaryExpr(); copy.setOperation(operation); copy.setOperand(operand != null ? operand.clone(cache) : null); copy.setType(type); return copy; } }
public static Expr invert(Expr expr) { UnaryExpr result = new UnaryExpr(); result.setOperand(expr); result.setOperation(UnaryOperation.NOT); result.setLocation(expr.getLocation()); return result; }
expr.setOperation(unaryOperations[input.readByte()]); byte valueType = input.readByte(); expr.setType(valueType > 0 ? OperationType.values()[valueType] : null);
public static Expr unary(UnaryOperation op, OperationType type, Expr arg) { UnaryExpr expr = new UnaryExpr(); expr.setOperand(arg); expr.setOperation(op); expr.setType(type); return expr; }
@Override protected Expr clone(Map<Expr, Expr> cache) { Expr known = cache.get(this); if (known != null) { return known; } UnaryExpr copy = new UnaryExpr(); copy.setOperation(operation); copy.setOperand(operand != null ? operand.clone(cache) : null); copy.setType(type); return copy; } }
public static Expr invert(Expr expr) { UnaryExpr result = new UnaryExpr(); result.setOperand(expr); result.setOperation(UnaryOperation.NOT); result.setLocation(expr.getLocation()); return result; }
expr.setOperation(unaryOperations[input.readByte()]); byte valueType = input.readByte(); expr.setType(valueType > 0 ? OperationType.values()[valueType] : null);