767778798081828384
case NOT: return left.not(env); case NEG: return left.neg(env); default: throw new ExpressionRuntimeException(getName() + " is not a binary operation"); } }
187188189190191192193194195196197198199200
} if (otherValue instanceof Number) { return innerCompare(AviatorNumber.valueOf(otherValue)); } else { throw new ExpressionRuntimeException("Could not compare " + this + " with " + other); } case Nil: return 1; default: throw new ExpressionRuntimeException("Could not compare " + this + " with " + other); } }
229230231232233234235236
} protected void ensureNumber(AviatorObject other) { if (other.getAviatorType() != AviatorType.Number) { throw new ExpressionRuntimeException("Operator only supports Number"); } }
35363738394041
public abstract AviatorType getAviatorType(); public AviatorObject match(AviatorObject other, Map<String, Object> env) { throw new ExpressionRuntimeException(desc(env) + " doesn't support match operation '=~'"); }
40414243444546
throw new ExpressionRuntimeException(desc(env) + " doesn't support match operation '=~'"); } public AviatorObject neg(Map<String, Object> env) { throw new ExpressionRuntimeException(desc(env) + " doesn't support negative operation '-'"); }
45464748495051
throw new ExpressionRuntimeException(desc(env) + " doesn't support negative operation '-'"); } public AviatorObject not(Map<String, Object> env) { throw new ExpressionRuntimeException(desc(env) + " doesn't support not operation '!'"); }
58596061626364
public abstract Object getValue(Map<String, Object> env); public AviatorObject add(AviatorObject other, Map<String, Object> env) { throw new ExpressionRuntimeException("Could not add " + this.desc(env) + " with " + other.desc(env)); }
63646566676869
throw new ExpressionRuntimeException("Could not add " + this.desc(env) + " with " + other.desc(env)); } public AviatorObject sub(AviatorObject other, Map<String, Object> env) { throw new ExpressionRuntimeException("Could not sub " + this.desc(env) + " with " + other.desc(env)); }
68697071727374
throw new ExpressionRuntimeException("Could not sub " + this.desc(env) + " with " + other.desc(env)); } public AviatorObject mod(AviatorObject other, Map<String, Object> env) { throw new ExpressionRuntimeException("Could not mod " + this.desc(env) + " with " + other.desc(env)); }
73747576777879
throw new ExpressionRuntimeException("Could not mod " + this.desc(env) + " with " + other.desc(env)); } public AviatorObject div(AviatorObject other, Map<String, Object> env) { throw new ExpressionRuntimeException("Could not div " + this.desc(env) + " with " + other.desc(env)); }