Skip to content

Commit 75a7fc4

Browse files
committed
Removed Opening and Closing historical artifacts.
1 parent e3429ca commit 75a7fc4

File tree

12 files changed

+107
-244
lines changed

12 files changed

+107
-244
lines changed

language-adaptors/rxjava-scala/src/main/scala/rx/lang/scala/Observable.scala

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -302,45 +302,44 @@ trait Observable[+T]
302302
* Creates an Observable which produces buffers of collected values.
303303
*
304304
* This Observable produces connected non-overlapping buffers. The current buffer is
305-
* emitted and replaced with a new buffer when the Observable produced by the specified function produces a [[rx.lang.scala.util.Closing]] object. The function will then
305+
* emitted and replaced with a new buffer when the Observable produced by the specified function produces an object. The function will then
306306
* be used to create a new Observable to listen for the end of the next buffer.
307307
*
308308
* @param closings
309309
* The function which is used to produce an [[rx.lang.scala.Observable]] for every buffer created.
310-
* When this [[rx.lang.scala.Observable]] produces a [[rx.lang.scala.util.Closing]] object, the associated buffer
310+
* When this [[rx.lang.scala.Observable]] produces an object, the associated buffer
311311
* is emitted and replaced with a new one.
312312
* @return
313313
* An [[rx.lang.scala.Observable]] which produces connected non-overlapping buffers, which are emitted
314-
* when the current [[rx.lang.scala.Observable]] created with the function argument produces a [[rx.lang.scala.util.Closing]] object.
314+
* when the current [[rx.lang.scala.Observable]] created with the function argument produces an object.
315315
*/
316-
def buffer(closings: () => Observable[Closing]) : Observable[Seq[T]] = {
316+
def buffer[Closing](closings: () => Observable[_ <: Closing]) : Observable[Seq[T]] = {
317317
val f: Func0[_ <: rx.Observable[_ <: Closing]] = closings().asJavaObservable
318-
val jObs: rx.Observable[_ <: java.util.List[_]] = asJavaObservable.buffer(f)
318+
val jObs: rx.Observable[_ <: java.util.List[_]] = asJavaObservable.buffer[Closing](f)
319319
Observable.jObsOfListToScObsOfSeq(jObs.asInstanceOf[rx.Observable[_ <: java.util.List[T]]])
320320
}
321-
322321
/**
323322
* Creates an Observable which produces buffers of collected values.
324323
*
325324
* This Observable produces buffers. Buffers are created when the specified `openings`
326-
* Observable produces a [[rx.lang.scala.util.Opening]] object. Additionally the function argument
325+
* Observable produces an object. Additionally the function argument
327326
* is used to create an Observable which produces [[rx.lang.scala.util.Closing]] objects. When this
328327
* Observable produces such an object, the associated buffer is emitted.
329328
*
330329
* @param openings
331-
* The [[rx.lang.scala.Observable]] which, when it produces a [[rx.lang.scala.util.Opening]] object, will cause
330+
* The [[rx.lang.scala.Observable]] which, when it produces an object, will cause
332331
* another buffer to be created.
333332
* @param closings
334333
* The function which is used to produce an [[rx.lang.scala.Observable]] for every buffer created.
335-
* When this [[rx.lang.scala.Observable]] produces a [[rx.lang.scala.util.Closing]] object, the associated buffer
334+
* When this [[rx.lang.scala.Observable]] produces an object, the associated buffer
336335
* is emitted.
337336
* @return
338337
* An [[rx.lang.scala.Observable]] which produces buffers which are created and emitted when the specified [[rx.lang.scala.Observable]]s publish certain objects.
339338
*/
340-
def buffer(openings: Observable[Opening], closings: Opening => Observable[Closing]): Observable[Seq[T]] = {
339+
def buffer[Opening, Closing](openings: Observable[Opening], closings: Opening => Observable[Closing]): Observable[Seq[T]] = {
341340
val opening: rx.Observable[_ <: Opening] = openings.asJavaObservable
342-
val closing: Func1[Opening, _ <: rx.Observable[_ <: Closing]] = (o: Opening) => closings(o).asJavaObservable
343-
val jObs: rx.Observable[_ <: java.util.List[_]] = asJavaObservable.buffer(opening, closing)
341+
val closing: Func1[_ >: Opening, _ <: rx.Observable[_ <: Closing]] = (o: Opening) => closings(o).asJavaObservable
342+
val jObs: rx.Observable[_ <: java.util.List[_]] = asJavaObservable.buffer[Opening, Closing](opening, closing)
344343
Observable.jObsOfListToScObsOfSeq(jObs.asInstanceOf[rx.Observable[_ <: java.util.List[T]]])
345344
}
346345

@@ -512,47 +511,47 @@ trait Observable[+T]
512511
/**
513512
* Creates an Observable which produces windows of collected values. This Observable produces connected
514513
* non-overlapping windows. The current window is emitted and replaced with a new window when the
515-
* Observable produced by the specified function produces a [[rx.lang.scala.util.Closing]] object.
514+
* Observable produced by the specified function produces an object.
516515
* The function will then be used to create a new Observable to listen for the end of the next
517516
* window.
518517
*
519518
* @param closings
520519
* The function which is used to produce an [[rx.lang.scala.Observable]] for every window created.
521-
* When this [[rx.lang.scala.Observable]] produces a [[rx.lang.scala.util.Closing]] object, the associated window
520+
* When this [[rx.lang.scala.Observable]] produces an object, the associated window
522521
* is emitted and replaced with a new one.
523522
* @return
524523
* An [[rx.lang.scala.Observable]] which produces connected non-overlapping windows, which are emitted
525-
* when the current [[rx.lang.scala.Observable]] created with the function argument produces a [[rx.lang.scala.util.Closing]] object.
524+
* when the current [[rx.lang.scala.Observable]] created with the function argument produces an object.
526525
*/
527-
def window(closings: () => Observable[Closing]): Observable[Observable[T]] = {
526+
def window[Closing](closings: () => Observable[Closing]): Observable[Observable[T]] = {
528527
val func : Func0[_ <: rx.Observable[_ <: Closing]] = closings().asJavaObservable
529-
val o1: rx.Observable[_ <: rx.Observable[_]] = asJavaObservable.window(func)
530-
val o2 = toScalaObservable[rx.Observable[_]](o1).map((x: rx.Observable[_]) => {
528+
val o1: rx.Observable[_ <: rx.Observable[_]] = asJavaObservable.window[Closing](func)
529+
val o2 = Observable[rx.Observable[_]](o1).map((x: rx.Observable[_]) => {
531530
val x2 = x.asInstanceOf[rx.Observable[_ <: T]]
532-
toScalaObservable[T](x2)
531+
Observable[T](x2)
533532
})
534533
o2
535534
}
536535

537536
/**
538537
* Creates an Observable which produces windows of collected values. This Observable produces windows.
539-
* Chunks are created when the specified `openings` Observable produces a [[rx.lang.scala.util.Opening]] object.
538+
* Chunks are created when the specified `openings` Observable produces an object.
540539
* Additionally the `closings` argument is used to create an Observable which produces [[rx.lang.scala.util.Closing]] objects.
541540
* When this Observable produces such an object, the associated window is emitted.
542541
*
543542
* @param openings
544-
* The [[rx.lang.scala.Observable]] which when it produces a [[rx.lang.scala.util.Opening]] object, will cause
543+
* The [[rx.lang.scala.Observable]] which when it produces an object, will cause
545544
* another window to be created.
546545
* @param closings
547546
* The function which is used to produce an [[rx.lang.scala.Observable]] for every window created.
548-
* When this [[rx.lang.scala.Observable]] produces a [[rx.lang.scala.util.Closing]] object, the associated window
547+
* When this [[rx.lang.scala.Observable]] produces an object, the associated window
549548
* is emitted.
550549
* @return
551550
* An [[rx.lang.scala.Observable]] which produces windows which are created and emitted when the specified [[rx.lang.scala.Observable]]s publish certain objects.
552551
*/
553-
def window(openings: Observable[Opening], closings: Opening => Observable[Closing]) = {
552+
def window[Opening, Closing](openings: Observable[Opening], closings: Opening => Observable[Closing]) = {
554553
Observable.jObsOfJObsToScObsOfScObs(
555-
asJavaObservable.window(openings.asJavaObservable, (op: Opening) => closings(op).asJavaObservable))
554+
asJavaObservable.window[Opening, Closing](openings.asJavaObservable, (op: Opening) => closings(op).asJavaObservable))
556555
: Observable[Observable[T]] // SI-7818
557556
}
558557

language-adaptors/rxjava-scala/src/main/scala/rx/lang/scala/util/package.scala

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,30 +20,6 @@ package rx.lang.scala
2020
*/
2121
package object util {
2222

23-
/**
24-
* Tagging interface for objects which can open buffers.
25-
* @see [[Observable `Observable.buffer(Observable[Opening], Opening => Observable[Closing])`]]
26-
*/
27-
type Opening = rx.util.Opening
28-
29-
/**
30-
* Creates an object which can open buffers.
31-
* @see [[Observable `Observable.buffer(Observable[Opening], Opening => Observable[Closing])`]]
32-
*/
33-
def Opening() = rx.util.Openings.create()
34-
35-
/**
36-
* Tagging interface for objects which can close buffers.
37-
* @see [[Observable `Observable.buffer(Observable[Opening], Opening => Observable[Closing])`]]
38-
*/
39-
type Closing = rx.util.Closing
40-
41-
/**
42-
* Creates an object which can close buffers.
43-
* @see [[Observable `Observable.buffer(Observable[Opening], Opening => Observable[Closing])`]]
44-
*/
45-
def Closing() = rx.util.Closings.create()
46-
4723
// rx.util.Range not needed because there's a standard Scala Range
4824

4925
}

rxjava-core/src/main/java/rx/Observable.java

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,7 @@
111111
import rx.subjects.ReplaySubject;
112112
import rx.subjects.Subject;
113113
import rx.subscriptions.Subscriptions;
114-
import rx.util.Closing;
115114
import rx.util.OnErrorNotImplementedException;
116-
import rx.util.Opening;
117115
import rx.util.Range;
118116
import rx.util.TimeInterval;
119117
import rx.util.Timestamped;
@@ -2812,31 +2810,31 @@ public static <T1, T2, T3, T4, T5, T6, T7, T8, T9, R> Observable<R> combineLates
28122810
return create(OperationCombineLatest.combineLatest(o1, o2, o3, o4, o5, o6, o7, o8, o9, combineFunction));
28132811
}
28142812

2815-
/**
2813+
/**
28162814
* Creates an Observable that produces buffers of collected items.
28172815
* <p>
28182816
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/buffer1.png">
28192817
* <p>
28202818
* This Observable produces connected, non-overlapping buffers. The current
28212819
* buffer is emitted and replaced with a new buffer when the Observable
2822-
* produced by the specified <code>bufferClosingSelector</code> produces a
2823-
* {@link rx.util.Closing} object. The <code>bufferClosingSelector</code>
2820+
* produced by the specified <code>bufferClosingSelector</code> produces an
2821+
* object. The <code>bufferClosingSelector</code>
28242822
* will then be used to create a new Observable to listen for the end of
28252823
* the next buffer.
28262824
*
28272825
* @param bufferClosingSelector the {@link Func0} which is used to produce
28282826
* an {@link Observable} for every buffer
28292827
* created. When this {@link Observable}
2830-
* produces a {@link rx.util.Closing} object,
2828+
* produces an object,
28312829
* the associated buffer is emitted and
28322830
* replaced with a new one.
28332831
* @return an {@link Observable} which produces connected, non-overlapping
28342832
* buffers, which are emitted when the current {@link Observable}
2835-
* created with the {@link Func0} argument produces a
2836-
* {@link rx.util.Closing} object
2833+
* created with the {@link Func0} argument produces an
2834+
* object
28372835
* @see <a href="https://github.com/Netflix/RxJava/wiki/Transforming-Observables#buffer">RxJava Wiki: buffer()</a>
28382836
*/
2839-
public Observable<List<T>> buffer(Func0<? extends Observable<? extends Closing>> bufferClosingSelector) {
2837+
public <TClosing> Observable<List<T>> buffer(Func0<? extends Observable<? extends TClosing>> bufferClosingSelector) {
28402838
return create(OperationBuffer.buffer(this, bufferClosingSelector));
28412839
}
28422840

@@ -2846,26 +2844,26 @@ public Observable<List<T>> buffer(Func0<? extends Observable<? extends Closing>>
28462844
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/buffer2.png">
28472845
* <p>
28482846
* This Observable produces buffers. Buffers are created when the specified
2849-
* <code>bufferOpenings</code> Observable produces a {@link rx.util.Opening}
2847+
* <code>bufferOpenings</code> Observable produces an
28502848
* object. Additionally the <code>bufferClosingSelector</code> argument is
2851-
* used to create an Observable which produces {@link rx.util.Closing}
2849+
* used to create an Observable which produces
28522850
* objects. When this Observable produces such an object, the associated
28532851
* buffer is emitted.
28542852
*
2855-
* @param bufferOpenings the {@link Observable} that, when it produces a
2856-
* {@link rx.util.Opening} object, will cause another
2853+
* @param bufferOpenings the {@link Observable} that, when it produces an
2854+
* object, will cause another
28572855
* buffer to be created
28582856
* @param bufferClosingSelector the {@link Func1} that is used to produce
28592857
* an {@link Observable} for every buffer
28602858
* created. When this {@link Observable}
2861-
* produces a {@link rx.util.Closing} object,
2859+
* produces an object,
28622860
* the associated buffer is emitted.
28632861
* @return an {@link Observable} that produces buffers that are created and
28642862
* emitted when the specified {@link Observable}s publish certain
28652863
* objects
28662864
* @see <a href="https://github.com/Netflix/RxJava/wiki/Transforming-Observables#buffer">RxJava Wiki: buffer()</a>
28672865
*/
2868-
public Observable<List<T>> buffer(Observable<? extends Opening> bufferOpenings, Func1<Opening, ? extends Observable<? extends Closing>> bufferClosingSelector) {
2866+
public <TOpening, TClosing> Observable<List<T>> buffer(Observable<? extends TOpening> bufferOpenings, Func1<? super TOpening, ? extends Observable<? extends TClosing>> bufferClosingSelector) {
28692867
return create(OperationBuffer.buffer(this, bufferOpenings, bufferClosingSelector));
28702868
}
28712869

@@ -3062,54 +3060,54 @@ public Observable<List<T>> buffer(long timespan, long timeshift, TimeUnit unit,
30623060
* Creates an Observable that produces windows of collected items. This
30633061
* Observable produces connected, non-overlapping windows. The current
30643062
* window is emitted and replaced with a new window when the Observable
3065-
* produced by the specified <code>closingSelector</code> produces a
3066-
* {@link rx.util.Closing} object. The <code>closingSelector</code> will
3063+
* produced by the specified <code>closingSelector</code> produces an
3064+
* object. The <code>closingSelector</code> will
30673065
* then be used to create a new Observable to listen for the end of the next
30683066
* window.
30693067
* <p>
30703068
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/window1.png">
30713069
*
30723070
* @param closingSelector the {@link Func0} used to produce an
30733071
* {@link Observable} for every window created. When this
3074-
* {@link Observable} emits a {@link rx.util.Closing} object, the
3072+
* {@link Observable} emits an object, the
30753073
* associated window is emitted and replaced with a new one.
30763074
* @return an {@link Observable} that produces connected, non-overlapping
30773075
* windows, which are emitted when the current {@link Observable}
3078-
* created with the <code>closingSelector</code> argument emits a
3079-
* {@link rx.util.Closing} object.
3076+
* created with the <code>closingSelector</code> argument emits an
3077+
* object.
30803078
* @see <a href="https://github.com/Netflix/RxJava/wiki/Transforming-Observables#window">RxJava Wiki: window()</a>
30813079
*/
3082-
public Observable<Observable<T>> window(Func0<? extends Observable<? extends Closing>> closingSelector) {
3080+
public <TClosing> Observable<Observable<T>> window(Func0<? extends Observable<? extends TClosing>> closingSelector) {
30833081
return create(OperationWindow.window(this, closingSelector));
30843082
}
30853083

30863084
/**
30873085
* Creates an Observable that produces windows of collected items. This
30883086
* Observable produces windows. Chunks are created when the
3089-
* <code>windowOpenings</code> Observable produces a {@link rx.util.Opening}
3087+
* <code>windowOpenings</code> Observable produces an
30903088
* object. Additionally the <code>closingSelector</code> argument creates an
3091-
* Observable that produces {@link rx.util.Closing} objects. When this
3089+
* Observable that produces objects. When this
30923090
* Observable produces such an object, the associated window is emitted.
30933091
* <p>
30943092
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/window2.png">
30953093
*
3096-
* @param windowOpenings the {@link Observable} that, when it produces a
3097-
* {@link rx.util.Opening} object, causes another
3094+
* @param windowOpenings the {@link Observable} that, when it produces an
3095+
* object, causes another
30983096
* window to be created
30993097
* @param closingSelector the {@link Func1} that produces an
31003098
* {@link Observable} for every window created. When
3101-
* this {@link Observable} produces a
3102-
* {@link rx.util.Closing} object, the associated
3099+
* this {@link Observable} produces an
3100+
* object, the associated
31033101
* window is emitted.
31043102
* @return an {@link Observable} that produces windows that are created and
31053103
* emitted when the specified {@link Observable}s publish certain
31063104
* objects
31073105
* @see <a href="https://github.com/Netflix/RxJava/wiki/Transforming-Observables#window">RxJava Wiki: window()</a>
31083106
*/
3109-
public Observable<Observable<T>> window(Observable<? extends Opening> windowOpenings, Func1<Opening, ? extends Observable<? extends Closing>> closingSelector) {
3107+
public <TOpening, TClosing> Observable<Observable<T>> window(Observable<? extends TOpening> windowOpenings, Func1<? super TOpening, ? extends Observable<? extends TClosing>> closingSelector) {
31103108
return create(OperationWindow.window(this, windowOpenings, closingSelector));
31113109
}
3112-
3110+
31133111
/**
31143112
* Creates an Observable that produces windows of collected items. This
31153113
* Observable produces connected, non-overlapping windows, each containing

0 commit comments

Comments
 (0)