Java Code Examples for io.reactivex.Observable.wrap()

The following are Jave code examples for showing how to use wrap() of the io.reactivex.Observable class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: RxJavaCollections   File: ObservableMap.java   Source Code and License Vote up 4 votes
public Observable<Map<K, V>> observableChanges() {
    return Observable.wrap(items);
}
 
Example 2
Project: RxJavaCollections   File: ObservableMap.java   Source Code and License Vote up 4 votes
private Observable<Map.Entry<K, V>> onPut() {
    return Observable.wrap(put);
}
 
Example 3
Project: RxJavaCollections   File: ObservableMap.java   Source Code and License Vote up 4 votes
private Observable<Map.Entry<K, V>> onAdded() {
    return Observable.wrap(added);
}
 
Example 4
Project: RxJavaCollections   File: ObservableMap.java   Source Code and License Vote up 4 votes
private Observable<Map.Entry<K, V>> onRemoved() {
    return Observable.wrap(removed);
}
 
Example 5
Project: RxJavaCollections   File: ObservableMap.java   Source Code and License Vote up 4 votes
private Observable<EntryChange<K, V>> onUpdated() {
    return Observable.wrap(updated);
}
 
Example 6
Project: RxJavaCollections   File: ObservableSet.java   Source Code and License Vote up 2 votes
/**
 * Emits a read-only copy of the list on subscription and whenever it the set is updated. If a method such as
 * {@link #addAll(Collection)} is used, it will emit a copy only once and only if the set was changed.
 *
 * @return The {@link Observable} object.
 */
@Override
public Observable<Set<E>> observableChanges() {
    return Observable.wrap(items);
}
 
Example 7
Project: RxJavaCollections   File: ObservableSet.java   Source Code and License Vote up 2 votes
/**
 * Returns an observable which emits a value when a new element is added to the set. The value emitted is the
 * element added to the set.
 *
 * @return The {@link Observable} object.
 */
public Observable<E> onAdded() {
    return Observable.wrap(added);
}
 
Example 8
Project: RxJavaCollections   File: ObservableSet.java   Source Code and License Vote up 2 votes
/**
 * Returns an observable which emits a value when an element is removed from the set. The value emitted is the
 * element removed from the set.
 *
 * @return The {@link Observable} object.
 */
public Observable<E> onRemoved() {
    return Observable.wrap(removed);
}
 
Example 9
Project: RxJavaCollections   File: ObservableList.java   Source Code and License Vote up 2 votes
/**
 * Emits a read-only copy of the list on subscription and whenever it the list is updated. If a method such as
 * {@link #addAll(Collection)} is used, it will emit a copy only once and only if the list was changed.
 *
 * @return The {@link Observable} object.
 */
@Override
public Observable<List<E>> observableChanges() {
    return Observable.wrap(items);
}
 
Example 10
Project: RxJavaCollections   File: ObservableList.java   Source Code and License Vote up 2 votes
/**
 * Returns an observable which emits a value when a new element is added to the list. The value emitted is an
 * {@link Indexed} object, which contains the index of the added element in the list and the element itself.
 *
 * @return The {@link Observable} object.
 */
public Observable<Indexed<E>> onAdded() {
    return Observable.wrap(added);
}
 
Example 11
Project: RxJavaCollections   File: ObservableList.java   Source Code and License Vote up 2 votes
/**
 * Returns an observable which emits a value when an element is removed from the list. The value emitted is an
 * {@link Indexed} object, which contains the index of the removed element in the list and the element itself.
 *
 * @return The {@link Observable} object.
 */
public Observable<Indexed<E>> onRemoved() {
    return Observable.wrap(removed);
}
 
Example 12
Project: RxJavaCollections   File: ObservableList.java   Source Code and License Vote up 2 votes
/**
 * Returns an observable which emits a value when an element in the list updated with a new value. The value emitted
 * is an {@link IndexedChange} object, which contains the index of the updated element in the list combined with the
 * old and new elements.
 *
 * @return The {@link Observable} object.
 */
public Observable<IndexedChange<E>> onUpdated() {
    return Observable.wrap(updated);
}
 
Example 13
Project: RxJavaCollections   File: ObservableList.java   Source Code and License Vote up 2 votes
/**
 * Returns an observable which emits a value when an element in the list updated with a new value, which differs
 * from the old value at that index. The value emitted is an {@link IndexedChange} object, which contains the index
 * of the updated element in the list combined with the old and new elements.
 *
 * @return The {@link Observable} object.
 */
public Observable<IndexedChange<E>> onUpdatedChanged() {
    return Observable.wrap(updatedChanged);
}
 
Example 14
Project: RxJavaCollections   File: ObservableList.java   Source Code and License Vote up 2 votes
/**
 * Returns an observable which emits a value when an element in the list is moved to a new and different index. The
 * value emitted is an {@link IndexedChange} object, which contains the index of the updated element in the list
 * combined with the old and new elements.
 *
 * @return The {@link Observable} object.
 */
public Observable<IndexedChange<E>> onMoved() {
    return Observable.wrap(moved);
}