ObservableIfc

interface ObservableIfc<T>

The Java Observer/Observable implementation has a number of flaws. This class represents an interface for objects that can be observed. Essentially, observable objects promise the basic management of classes that implement the ObserverIfc

Author

rossetti

Inheritors

Functions

Link copied to clipboard
abstract fun attachObserver(observer: ObserverIfc<T>)

Allows the adding (attaching) of an observer to the observable

Link copied to clipboard
abstract fun countObservers(): Int

Returns how many observers are currently attached to the observable

Link copied to clipboard
abstract fun detachAllObservers()

Detaches all the observers from the observable

Link copied to clipboard
abstract fun detachObserver(observer: ObserverIfc<T>)

Allows the deletion (removing) of an observer from the observable

Link copied to clipboard
abstract fun isAttached(observer: ObserverIfc<T>): Boolean

Returns true if the observer is already attached