com.generationjava.lang
Class Notifier

java.lang.Object
  |
  +--com.generationjava.lang.Notifier

public class Notifier
extends java.lang.Object


Constructor Summary
Notifier(java.lang.Class listener)
           
Notifier(java.lang.Class clss, java.lang.String name)
          Construct with the class and the name of the method to call upon the listeners.
 
Method Summary
 void addListener(java.lang.Object not)
           
 java.util.ArrayList getListeners()
           
 void notify(java.util.EventObject event)
          Convenience method for when a listener has a single method.
 void notify(java.lang.String methodName, java.util.EventObject event)
          Notify the listeners of a certain event, to a certain method.
 void removeListener(java.lang.Object not)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Notifier

public Notifier(java.lang.Class listener)

Notifier

public Notifier(java.lang.Class clss,
                java.lang.String name)

Construct with the class and the name of the method to call upon the listeners.

Method Detail

addListener

public void addListener(java.lang.Object not)

removeListener

public void removeListener(java.lang.Object not)

getListeners

public java.util.ArrayList getListeners()

notify

public void notify(java.util.EventObject event)
            throws NotifierException

Convenience method for when a listener has a single method.

Currently this method needs to be called, but it's possible that by providing the interface class, it can be assumed as to what the listening method is.

NotifierException

notify

public void notify(java.lang.String methodName,
                   java.util.EventObject event)
            throws NotifierException

Notify the listeners of a certain event, to a certain method.

This is usable when a Listener has more than one method and a single Notifier wants to be shared.

NotifierException


Copyright © 2000-2003 OSJava. All Rights Reserved.