Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## it.gotoandplay.smartfoxclient
Class SFSEventDispatcher

    java.lang.Object
      it.gotoandplay.smartfoxclient.SFSEventDispatcher

Direct Known Subclasses:
  HttpConnection, SmartFoxClient

    public class SFSEventDispatcher

extends java.lang.Object

SFSEventDispatcher is used by the `SmartFoxClient` class to notify about SmartFoxServer related events.

Version:
  1.0.0
Author:
  The gotoAndPlay() Team
  http://www.smartfoxserver.com
  http://www.gotoandplay.it
See Also:
  `SmartFoxClient`, `SFSEvent`, `ISFSEventListener`

Constructor Summary
`SFSEventDispatcher()` The constructor.

Method Summary
`boolean` | `addEventListener(java.lang.String event, ISFSEventListener listener)` Adds a new event listener.
`void` | `dispatchEvent(SFSEvent eventObject)`
`boolean` | `removeEventListener(java.lang.String event, ISFSEventListener listener)` Removes event listener.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SFSEventDispatcher

    public SFSEventDispatcher()

  The constructor.

Method Detail

### addEventListener

    public boolean addEventListener(java.lang.String event,
                                    ISFSEventListener listener)
                             throws java.lang.NullPointerException

  Adds a new event listener. Multiple listeners can be registered for single event and single listener can be registered for multiple events.

  When event is dispached SFSEventDispatcher calls all listeners that are registered for the event but dosen't call them in any particular order.

  Parameters:
    `event` - the name of the event that listener listens for.
    `listener` - the event listener.
  Returns:
    `true` if the listener is registered, otherwise `flase`. Listener may not be registered if its already registered for the same event.
  Throws:
    `java.lang.NullPointerException` - if listener == null

### removeEventListener

    public boolean removeEventListener(java.lang.String event,
                                       ISFSEventListener listener)

  Removes event listener.

  Parameters:
    `event` - the name of the event listener was registered for.
    `listener` - the listener that should be removed.
  Returns:
    `true` if the listener is removed, otherwise `flase`. Listener may not be removed if its haven't been registered for this event or its already removed.

### dispatchEvent

    public void dispatchEvent(SFSEvent eventObject)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD