public final class Observable extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
Observable.Function |
static interface |
Observable.Observer |
static interface |
Observable.Predicate |
| Constructor and Description |
|---|
Observable(Object initialValue)
Creates a new observable from an initial value.
|
| Modifier and Type | Method and Description |
|---|---|
Observable |
filter(Observable.Predicate predicate)
Creates an observer that filters the values of this observable.
|
Object |
get()
Gets the current value.
|
Observable |
map(Observable.Function function)
Creates an observer that maps the values of this observable.
|
Observable |
onChange(Observable.Observer observer)
Registers an observer.
|
void |
set(Object newValue)
Changes the current value and notifies all observers.
|
String |
toString() |
public Observable(Object initialValue)
initialValue - the initial value.public Object get()
public void set(Object newValue)
newValue - the new value.public Observable onChange(Observable.Observer observer)
observer - an observer.public Observable filter(Observable.Predicate predicate)
predicate - a predicate function.public Observable map(Observable.Function function)
function - a mapping function.Copyright © 2014 Institut National des Sciences Appliquées de Lyon (INSA-Lyon). All Rights Reserved.