Returns an Observable that emits a sequence of Integers within a specified range. Scheduler: range does not operate by defa
(int start, int count)
| 3924 | * @see #intervalRange(long, long, long, long, TimeUnit) |
| 3925 | */ |
| 3926 | @CheckReturnValue |
| 3927 | @SchedulerSupport(SchedulerSupport.NONE) |
| 3928 | @NonNull |
| 3929 | public static Observable<Integer> range(int start, int count) { |
| 3930 | if (count < 0) { |
| 3931 | throw new IllegalArgumentException("count >= 0 required but it was " + count); |
| 3932 | } |
| 3933 | if (count == 0) { |
| 3934 | return empty(); |
| 3935 | } |
| 3936 | if (count == 1) { |
| 3937 | return just(start); |
| 3938 | } |
| 3939 | if ((long)start + (count - 1) > Integer.MAX_VALUE) { |
| 3940 | throw new IllegalArgumentException("Integer overflow"); |
| 3941 | } |
| 3942 | return RxJavaPlugins.onAssembly(new ObservableRange(start, count)); |
| 3943 | } |
| 3944 | |
| 3945 | /** |
| 3946 | * Returns an {@code Observable} that emits a sequence of {@link Long}s within a specified range. |