Returns a Flowable that emits a sequence of Integers within a specified range. Backpressure: The operator honors backpressure from
(int start, int count)
| 4414 | * @see #intervalRange(long, long, long, long, TimeUnit) |
| 4415 | */ |
| 4416 | @CheckReturnValue |
| 4417 | @BackpressureSupport(BackpressureKind.FULL) |
| 4418 | @SchedulerSupport(SchedulerSupport.NONE) |
| 4419 | @NonNull |
| 4420 | public static Flowable<Integer> range(int start, int count) { |
| 4421 | if (count < 0) { |
| 4422 | throw new IllegalArgumentException("count >= 0 required but it was " + count); |
| 4423 | } else |
| 4424 | if (count == 0) { |
| 4425 | return empty(); |
| 4426 | } else |
| 4427 | if (count == 1) { |
| 4428 | return just(start); |
| 4429 | } else |
| 4430 | if ((long)start + (count - 1) > Integer.MAX_VALUE) { |
| 4431 | throw new IllegalArgumentException("Integer overflow"); |
| 4432 | } |
| 4433 | return RxJavaPlugins.onAssembly(new FlowableRange(start, count)); |
| 4434 | } |
| 4435 | |
| 4436 | /** |
| 4437 | * Returns a {@code Flowable} that emits a sequence of {@link Long}s within a specified range. |