@@ -2253,6 +2253,68 @@ trait Observable[+T]
2253
2253
toScalaObservable[T ](asJavaObservable.retry())
2254
2254
}
2255
2255
2256
+ /**
2257
+ * Returns an Observable that repeats the sequence of items emitted by the source Observable indefinitely.
2258
+ * <p>
2259
+ * <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/repeat.o.png">
2260
+ *
2261
+ * @return an Observable that emits the items emitted by the source Observable repeatedly and in sequence
2262
+ * @see <a href="https://github.com/Netflix/RxJava/wiki/Creating-Observables#wiki-repeat">RxJava Wiki: repeat()</a>
2263
+ * @see <a href="http://msdn.microsoft.com/en-us/library/hh229428.aspx">MSDN: Observable.Repeat</a>
2264
+ */
2265
+ def repeat (): Observable [T ] = {
2266
+ toScalaObservable[T ](asJavaObservable.repeat())
2267
+ }
2268
+
2269
+ /**
2270
+ * Returns an Observable that repeats the sequence of items emitted by the source Observable indefinitely,
2271
+ * on a particular Scheduler.
2272
+ * <p>
2273
+ * <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/repeat.os.png">
2274
+ *
2275
+ * @param scheduler the Scheduler to emit the items on
2276
+ * @return an Observable that emits the items emitted by the source Observable repeatedly and in sequence
2277
+ * @see <a href="https://github.com/Netflix/RxJava/wiki/Creating-Observables#wiki-repeat">RxJava Wiki: repeat()</a>
2278
+ * @see <a href="http://msdn.microsoft.com/en-us/library/hh229428.aspx">MSDN: Observable.Repeat</a>
2279
+ */
2280
+ def repeat (scheduler : Scheduler ): Observable [T ] = {
2281
+ toScalaObservable[T ](asJavaObservable.repeat(scheduler))
2282
+ }
2283
+
2284
+ /**
2285
+ * Returns an Observable that repeats the sequence of items emitted by the source Observable at most `count` times.
2286
+ * <p>
2287
+ * <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/repeat.on.png">
2288
+ *
2289
+ * @param count the number of times the source Observable items are repeated,
2290
+ * a count of 0 will yield an empty sequence
2291
+ * @return an Observable that repeats the sequence of items emitted by the source Observable at most `count` times
2292
+ * @throws IllegalArgumentException if `count` is less than zero
2293
+ * @see <a href="https://github.com/Netflix/RxJava/wiki/Creating-Observables#wiki-repeat">RxJava Wiki: repeat()</a>
2294
+ * @see <a href="http://msdn.microsoft.com/en-us/library/hh229428.aspx">MSDN: Observable.Repeat</a>
2295
+ */
2296
+ def repeat (count : Long ): Observable [T ] = {
2297
+ toScalaObservable[T ](asJavaObservable.repeat(count))
2298
+ }
2299
+
2300
+ /**
2301
+ * Returns an Observable that repeats the sequence of items emitted by the source Observable
2302
+ * at most `count` times, on a particular Scheduler.
2303
+ * <p>
2304
+ * <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/repeat.ons.png">
2305
+ *
2306
+ * @param count the number of times the source Observable items are repeated,
2307
+ * a count of 0 will yield an empty sequence
2308
+ * @param scheduler the `Scheduler` to emit the items on
2309
+ * @return an Observable that repeats the sequence of items emitted by the source Observable at most `count` times
2310
+ * on a particular Scheduler
2311
+ * @see <a href="https://github.com/Netflix/RxJava/wiki/Creating-Observables#wiki-repeat">RxJava Wiki: repeat()</a>
2312
+ * @see <a href="http://msdn.microsoft.com/en-us/library/hh229428.aspx">MSDN: Observable.Repeat</a>
2313
+ */
2314
+ def repeat (count : Long , scheduler : Scheduler ): Observable [T ] = {
2315
+ toScalaObservable[T ](asJavaObservable.repeat(count, scheduler))
2316
+ }
2317
+
2256
2318
/**
2257
2319
* Converts an Observable into a [[rx.lang.scala.observables.BlockingObservable ]] (an Observable with blocking
2258
2320
* operators).
0 commit comments