jamod at SF

net.wimpi.modbus.util
Class Observable

java.lang.Object
  extended bynet.wimpi.modbus.util.Observable
Direct Known Subclasses:
ObservableDigitalOut, ObservableRegister

public class Observable
extends java.lang.Object

A cleanroom implementation of the Observable pattern.

Version:
1.2rc1 (09/11/2004)
Author:
Dieter Wimberger (wimpi)

Constructor Summary
Observable()
          Constructs a new Observable instance.
 
Method Summary
 void addObserver(Observer o)
          Adds an observer instance if it is not already in the set of observers for this Observable.
 int getObserverCount()
           
 void notifyObservers(java.lang.Object arg)
          Notifies all observer instances in the set of observers of this Observable.
 void removeObserver(Observer o)
          Removes an observer instance from the set of observers of this Observable.
 void removeObservers()
          Removes all observer instances from the set of observers of this Observable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Observable

public Observable()
Constructs a new Observable instance.

Method Detail

getObserverCount

public int getObserverCount()

addObserver

public void addObserver(Observer o)
Adds an observer instance if it is not already in the set of observers for this Observable.

Parameters:
o - an observer instance to be added.

removeObserver

public void removeObserver(Observer o)
Removes an observer instance from the set of observers of this Observable.

Parameters:
o - an observer instance to be removed.

removeObservers

public void removeObservers()
Removes all observer instances from the set of observers of this Observable.


notifyObservers

public void notifyObservers(java.lang.Object arg)
Notifies all observer instances in the set of observers of this Observable.

Parameters:
arg - an arbitrary argument to be passed.

jamod at SF

Copyright © 2002-2004 jamod development team.