File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
rxjava-core/src/main/java/rx/subjects Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change 15
15
*/
16
16
package rx .subjects ;
17
17
18
- import static org .mockito .Matchers .any ;
19
- import static org .mockito .Mockito .mock ;
20
- import static org .mockito .Mockito .times ;
21
- import static org .mockito .Mockito .verify ;
18
+ import static org .mockito .Matchers .*;
19
+ import static org .mockito .Mockito .*;
22
20
23
21
import java .util .concurrent .ConcurrentHashMap ;
24
22
import java .util .concurrent .atomic .AtomicReference ;
35
33
import rx .util .functions .Func1 ;
36
34
37
35
/**
38
- * Subject that publishes the previous and all subsequent events to each {@link Observer} that subscribes.
36
+ * Subject that publishes the last and all subsequent events to each {@link Observer} that subscribes.
39
37
* <p>
40
38
* Example usage:
41
39
* <p>
61
59
*/
62
60
public class BehaviorSubject <T > extends Subject <T , T > {
63
61
62
+ /**
63
+ * Creates a {@link BehaviorSubject} which publishes the last and all subsequent events to each
64
+ * {@link Observer} that subscribes to it.
65
+ *
66
+ * @param defaultValue
67
+ * The value which will be published to any {@link Observer} as long as the
68
+ * {@link BehaviorSubject} has not yet received any events.
69
+ * @return the constructed {@link BehaviorSubject}.
70
+ */
64
71
public static <T > BehaviorSubject <T > createWithDefaultValue (T defaultValue ) {
65
72
final ConcurrentHashMap <Subscription , Observer <T >> observers = new ConcurrentHashMap <Subscription , Observer <T >>();
66
73
You can’t perform that action at this time.
0 commit comments