Observable

public interface Observable

Defines interface methods for logging changes in a microscope component.

Author:Kyle M. Douglass

Methods

addListener

public void addListener(Listener listener)

Adds a new listener to the list of subscribed listeners.

Parameters:
  • listener – The listener to add to the list of subscribed listeners.

deleteListener

public void deleteListener(Listener listener)

Deletes a listener from the list of subscribed listeners.

Parameters:
  • listener – The listener to delete from the list of listeners.

notifyListeners

public void notifyListeners()

Notifies all subscribed listeners to a change in the Observable’s state. This method should only be called if setChanged() has been called.

notifyListeners

public void notifyListeners(Object data)

Notifies all subscribed listeners of a state change and pushes the data.

Parameters:
  • data – The data object to push to the listeners.

setChanged

public void setChanged()

Indicates that the state of this Observable has been changed.