From aa423afe518e998fb0a70c987e529f3b4af954f5 Mon Sep 17 00:00:00 2001
From: Ben Christensen A library that enables subscribing to and composing asynchronous events and
- callbacks. The Observable/Observer interfaces and associated operators (in
- the .operations package) are inspired by and attempt to conform to the
- Reactive Rx library in Microsoft .Net.
- More information can be found at http://msdn.microsoft.com/en-us/data/gg577609.
- Compared with the Microsoft implementation:
-
-
-
Services which intend on exposing data asynchronously and wish - to allow reactive processing and composition can implement the - Watchable interface which then allows Watchers to subscribe to them - and receive events.
-Usage examples can be found on the Watchable and Watcher - classes.
- \ No newline at end of file diff --git a/rxjava-core/src/main/java/rx/concurrency/package-info.java b/rxjava-core/src/main/java/rx/concurrency/package-info.java new file mode 100644 index 0000000000..56e3680f1d --- /dev/null +++ b/rxjava-core/src/main/java/rx/concurrency/package-info.java @@ -0,0 +1,19 @@ +/** + * Copyright 2013 Netflix, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Rx Schedulers + */ +package rx.concurrency; \ No newline at end of file diff --git a/rxjava-core/src/main/java/org/rx/reactive/CompositeException.java b/rxjava-core/src/main/java/rx/observables/CompositeException.java similarity index 98% rename from rxjava-core/src/main/java/org/rx/reactive/CompositeException.java rename to rxjava-core/src/main/java/rx/observables/CompositeException.java index ab07c7df79..53035a3312 100644 --- a/rxjava-core/src/main/java/org/rx/reactive/CompositeException.java +++ b/rxjava-core/src/main/java/rx/observables/CompositeException.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.rx.reactive; +package rx.observables; import java.util.ArrayList; import java.util.Collection; diff --git a/rxjava-core/src/main/java/org/rx/reactive/Notification.java b/rxjava-core/src/main/java/rx/observables/Notification.java similarity index 99% rename from rxjava-core/src/main/java/org/rx/reactive/Notification.java rename to rxjava-core/src/main/java/rx/observables/Notification.java index 397fe0ce11..b8ed2056cf 100644 --- a/rxjava-core/src/main/java/org/rx/reactive/Notification.java +++ b/rxjava-core/src/main/java/rx/observables/Notification.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.rx.reactive; +package rx.observables; /** * An object representing a notification sent to a Observable. diff --git a/rxjava-core/src/main/java/org/rx/reactive/Observable.java b/rxjava-core/src/main/java/rx/observables/Observable.java similarity index 98% rename from rxjava-core/src/main/java/org/rx/reactive/Observable.java rename to rxjava-core/src/main/java/rx/observables/Observable.java index 37b8e3a86f..10ce069cc1 100644 --- a/rxjava-core/src/main/java/org/rx/reactive/Observable.java +++ b/rxjava-core/src/main/java/rx/observables/Observable.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.rx.reactive; +package rx.observables; import static org.mockito.Matchers.*; import static org.mockito.Mockito.*; @@ -27,29 +27,30 @@ import org.junit.Test; import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import org.rx.functions.Func1; -import org.rx.functions.Func2; -import org.rx.functions.Func3; -import org.rx.functions.Func4; -import org.rx.functions.Functions; -import org.rx.operations.OperationFilter; -import org.rx.operations.OperationLast; -import org.rx.operations.OperationMap; -import org.rx.operations.OperationMaterialize; -import org.rx.operations.OperationMerge; -import org.rx.operations.OperationMergeDelayError; -import org.rx.operations.OperationOnErrorResumeNextViaFunction; -import org.rx.operations.OperationOnErrorResumeNextViaObservable; -import org.rx.operations.OperationOnErrorReturn; -import org.rx.operations.OperationScan; -import org.rx.operations.OperationSkip; -import org.rx.operations.OperationSynchronize; -import org.rx.operations.OperationTake; -import org.rx.operations.OperationToObservableFunction; -import org.rx.operations.OperationToObservableIterable; -import org.rx.operations.OperationToObservableList; -import org.rx.operations.OperationToObservableSortedList; -import org.rx.operations.OperationZip; + +import rx.observables.operations.OperationFilter; +import rx.observables.operations.OperationLast; +import rx.observables.operations.OperationMap; +import rx.observables.operations.OperationMaterialize; +import rx.observables.operations.OperationMerge; +import rx.observables.operations.OperationMergeDelayError; +import rx.observables.operations.OperationOnErrorResumeNextViaFunction; +import rx.observables.operations.OperationOnErrorResumeNextViaObservable; +import rx.observables.operations.OperationOnErrorReturn; +import rx.observables.operations.OperationScan; +import rx.observables.operations.OperationSkip; +import rx.observables.operations.OperationSynchronize; +import rx.observables.operations.OperationTake; +import rx.observables.operations.OperationToObservableFunction; +import rx.observables.operations.OperationToObservableIterable; +import rx.observables.operations.OperationToObservableList; +import rx.observables.operations.OperationToObservableSortedList; +import rx.observables.operations.OperationZip; +import rx.util.Func1; +import rx.util.Func2; +import rx.util.Func3; +import rx.util.Func4; +import rx.util.Functions; /** * The Observable interface that implements the Reactive Pattern. diff --git a/rxjava-core/src/main/java/org/rx/reactive/Observer.java b/rxjava-core/src/main/java/rx/observables/Observer.java similarity index 99% rename from rxjava-core/src/main/java/org/rx/reactive/Observer.java rename to rxjava-core/src/main/java/rx/observables/Observer.java index 3d14d88a1f..6cd9250f3c 100644 --- a/rxjava-core/src/main/java/org/rx/reactive/Observer.java +++ b/rxjava-core/src/main/java/rx/observables/Observer.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.rx.reactive; +package rx.observables; /** * Provides a mechanism for receiving push-based notifications. diff --git a/rxjava-core/src/main/java/org/rx/reactive/Subscription.java b/rxjava-core/src/main/java/rx/observables/Subscription.java similarity index 97% rename from rxjava-core/src/main/java/org/rx/reactive/Subscription.java rename to rxjava-core/src/main/java/rx/observables/Subscription.java index 315d6e1f94..9e4955ee8f 100644 --- a/rxjava-core/src/main/java/org/rx/reactive/Subscription.java +++ b/rxjava-core/src/main/java/rx/observables/Subscription.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.rx.reactive; +package rx.observables; public interface Subscription { diff --git a/rxjava-core/src/main/java/org/rx/operations/AtomicObservableSubscription.java b/rxjava-core/src/main/java/rx/observables/operations/AtomicObservableSubscription.java similarity index 97% rename from rxjava-core/src/main/java/org/rx/operations/AtomicObservableSubscription.java rename to rxjava-core/src/main/java/rx/observables/operations/AtomicObservableSubscription.java index 2e73d754da..d297f5a8e6 100644 --- a/rxjava-core/src/main/java/org/rx/operations/AtomicObservableSubscription.java +++ b/rxjava-core/src/main/java/rx/observables/operations/AtomicObservableSubscription.java @@ -13,14 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.rx.operations; +package rx.observables.operations; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; import javax.annotation.concurrent.ThreadSafe; -import org.rx.reactive.Subscription; +import rx.observables.Subscription; /** * Thread-safe wrapper around ObservableSubscription that ensures unsubscribe can be called only once. diff --git a/rxjava-core/src/main/java/org/rx/operations/AtomicObserver.java b/rxjava-core/src/main/java/rx/observables/operations/AtomicObserver.java similarity index 97% rename from rxjava-core/src/main/java/org/rx/operations/AtomicObserver.java rename to rxjava-core/src/main/java/rx/observables/operations/AtomicObserver.java index e8a8b9f3ea..40ec4f09ae 100644 --- a/rxjava-core/src/main/java/org/rx/operations/AtomicObserver.java +++ b/rxjava-core/src/main/java/rx/observables/operations/AtomicObserver.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.rx.operations; +package rx.observables.operations; import javax.annotation.concurrent.ThreadSafe; -import org.rx.reactive.Observer; +import rx.observables.Observer; /** * A thread-safe Observer for transitioning states in operators. diff --git a/rxjava-core/src/main/java/org/rx/operations/AtomicObserverMultiThreaded.java b/rxjava-core/src/main/java/rx/observables/operations/AtomicObserverMultiThreaded.java similarity index 99% rename from rxjava-core/src/main/java/org/rx/operations/AtomicObserverMultiThreaded.java rename to rxjava-core/src/main/java/rx/observables/operations/AtomicObserverMultiThreaded.java index 7d20ba1471..44a474af5e 100644 --- a/rxjava-core/src/main/java/org/rx/operations/AtomicObserverMultiThreaded.java +++ b/rxjava-core/src/main/java/rx/observables/operations/AtomicObserverMultiThreaded.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.rx.operations; +package rx.observables.operations; import static org.junit.Assert.*; import static org.mockito.Matchers.*; @@ -33,9 +33,10 @@ import org.junit.Test; import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import org.rx.reactive.Observable; -import org.rx.reactive.Observer; -import org.rx.reactive.Subscription; + +import rx.observables.Observable; +import rx.observables.Observer; +import rx.observables.Subscription; /** * A thread-safe Observer for transitioning states in operators. diff --git a/rxjava-core/src/main/java/org/rx/operations/AtomicObserverSingleThreaded.java b/rxjava-core/src/main/java/rx/observables/operations/AtomicObserverSingleThreaded.java similarity index 99% rename from rxjava-core/src/main/java/org/rx/operations/AtomicObserverSingleThreaded.java rename to rxjava-core/src/main/java/rx/observables/operations/AtomicObserverSingleThreaded.java index ca139e658d..16c30ac1d2 100644 --- a/rxjava-core/src/main/java/org/rx/operations/AtomicObserverSingleThreaded.java +++ b/rxjava-core/src/main/java/rx/observables/operations/AtomicObserverSingleThreaded.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.rx.operations; +package rx.observables.operations; import static org.junit.Assert.*; import static org.mockito.Matchers.*; @@ -32,9 +32,10 @@ import org.junit.Test; import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import org.rx.reactive.Observable; -import org.rx.reactive.Observer; -import org.rx.reactive.Subscription; + +import rx.observables.Observable; +import rx.observables.Observer; +import rx.observables.Subscription; /** * A thread-safe Observer for transitioning states in operators. diff --git a/rxjava-core/src/main/java/org/rx/operations/OperationCombineLatest.java b/rxjava-core/src/main/java/rx/observables/operations/OperationCombineLatest.java similarity index 99% rename from rxjava-core/src/main/java/org/rx/operations/OperationCombineLatest.java rename to rxjava-core/src/main/java/rx/observables/operations/OperationCombineLatest.java index ccba74236d..e4f4835b9e 100644 --- a/rxjava-core/src/main/java/org/rx/operations/OperationCombineLatest.java +++ b/rxjava-core/src/main/java/rx/observables/operations/OperationCombineLatest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.rx.operations; +package rx.observables.operations; import static org.mockito.Matchers.*; import static org.mockito.Mockito.*; @@ -28,14 +28,15 @@ import org.junit.Test; import org.mockito.InOrder; -import org.rx.functions.Func2; -import org.rx.functions.Func3; -import org.rx.functions.Func4; -import org.rx.functions.FuncN; -import org.rx.functions.Functions; -import org.rx.reactive.Observable; -import org.rx.reactive.Observer; -import org.rx.reactive.Subscription; + +import rx.observables.Observable; +import rx.observables.Observer; +import rx.observables.Subscription; +import rx.util.Func2; +import rx.util.Func3; +import rx.util.Func4; +import rx.util.FuncN; +import rx.util.Functions; public class OperationCombineLatest { diff --git a/rxjava-core/src/main/java/org/rx/operations/OperationFilter.java b/rxjava-core/src/main/java/rx/observables/operations/OperationFilter.java similarity index 95% rename from rxjava-core/src/main/java/org/rx/operations/OperationFilter.java rename to rxjava-core/src/main/java/rx/observables/operations/OperationFilter.java index a55624aadb..a4d228e40b 100644 --- a/rxjava-core/src/main/java/org/rx/operations/OperationFilter.java +++ b/rxjava-core/src/main/java/rx/observables/operations/OperationFilter.java @@ -13,17 +13,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.rx.operations; +package rx.observables.operations; import static org.mockito.Matchers.*; import static org.mockito.Mockito.*; import org.junit.Test; import org.mockito.Mockito; -import org.rx.functions.Func1; -import org.rx.reactive.Observable; -import org.rx.reactive.Observer; -import org.rx.reactive.Subscription; + +import rx.observables.Observable; +import rx.observables.Observer; +import rx.observables.Subscription; +import rx.util.Func1; public final class OperationFilterRx Observables
+ * + *A library that enables subscribing to and composing asynchronous events and + * callbacks.
+ *The Observable/Observer interfaces and associated operators (in + * the .operations package) are inspired by and attempt to conform to the + * Reactive Rx library in Microsoft .Net.
+ *+ * More information can be found at http://msdn.microsoft.com/en-us/data/gg577609. + *
+ * + * + *Compared with the Microsoft implementation: + *
Services which intend on exposing data asynchronously and wish + * to allow reactive processing and composition can implement the + * Watchable interface which then allows Watchers to subscribe to them + * and receive events.
+ *Usage examples can be found on the Watchable and Watcher + * classes.
+ */ +package rx.observables; \ No newline at end of file diff --git a/rxjava-core/src/main/java/rx/util/Action0.java b/rxjava-core/src/main/java/rx/util/Action0.java new file mode 100644 index 0000000000..b8cc6d9c99 --- /dev/null +++ b/rxjava-core/src/main/java/rx/util/Action0.java @@ -0,0 +1,20 @@ +/** + * Copyright 2013 Netflix, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package rx.util; + +public interface Action0 { + public void call(); +} \ No newline at end of file diff --git a/rxjava-core/src/main/java/rx/util/Action1.java b/rxjava-core/src/main/java/rx/util/Action1.java new file mode 100644 index 0000000000..efdc4daa44 --- /dev/null +++ b/rxjava-core/src/main/java/rx/util/Action1.java @@ -0,0 +1,20 @@ +/** + * Copyright 2013 Netflix, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package rx.util; + +public interface Action1
From 4b4d4fe741e9396560b186427a15faf803d423de Mon Sep 17 00:00:00 2001
From: Ben Christensen onError
* @return the source Observable, with its behavior modified as described
*/
- public static > toSortedList(Observable
> toSortedList(Observable
> toSortedList(Observable
> toSortedList(Observable
> toSortedList(Observable