public IValue multiply(IValue other) { DataType dataType = getDataType().evaluate(OperatorKind.MULTIPLY, other.getDataType()); if (dataType instanceof InvalidDataType) { return InvalidValue.SINGLETON; } if (other instanceof AnyValue) { return new AnyValue(getContext(), dataType); } if (other instanceof UninitializedValue || other instanceof InvalidValue) { return InvalidValue.SINGLETON; } return doMultiply(other, dataType); }
public IValue subtract(IValue other) { DataType dataType = getDataType().evaluate(OperatorKind.SUBTRACT, other.getDataType()); if (dataType instanceof InvalidDataType) { return InvalidValue.SINGLETON; } if (other instanceof AnyValue) { return new AnyValue(getContext(), dataType); } if (other instanceof UninitializedValue || other instanceof InvalidValue) { return InvalidValue.SINGLETON; } return doSubtract(other, dataType); }
public IValue greaterThan(IValue other) { DataType dataType = getDataType().evaluate(OperatorKind.GREATER_THAN, other.getDataType()); if (dataType instanceof InvalidDataType) { return InvalidValue.SINGLETON; } if (other instanceof AnyValue) { return new AnyValue(getContext(), dataType); } if (other instanceof UninitializedValue || other instanceof InvalidValue) { return InvalidValue.SINGLETON; } return doGreaterThan(other, dataType); }
public IValue notEqualTo(IValue other) { DataType dataType = getDataType().evaluate(OperatorKind.NOT_EQUAL_TO, other.getDataType()); if (dataType instanceof InvalidDataType) { return InvalidValue.SINGLETON; } if (other instanceof AnyValue) { return new AnyValue(getContext(), dataType); } if (other instanceof UninitializedValue || other instanceof InvalidValue) { return InvalidValue.SINGLETON; } return doNotEqualTo(other, dataType); }
public IValue divide(IValue other) { DataType dataType = getDataType().evaluate(OperatorKind.DIVIDE, other.getDataType()); if (dataType instanceof InvalidDataType) { return InvalidValue.SINGLETON; } if (other instanceof AnyValue) { return new AnyValue(getContext(), dataType); } if (other instanceof UninitializedValue || other instanceof InvalidValue) { return InvalidValue.SINGLETON; } return doDivide(other, dataType); }