com.tensegrity.generic.event
Class EventMultiplexer

java.lang.Object
  extended bycom.tensegrity.generic.event.EventMultiplexer
All Implemented Interfaces:
EventListenerTag
Direct Known Subclasses:
AttributableOnSetEventMultiplexer, CompositeEventMultiplexer, CompositeTableModelMultiplexer, CompositeTableSelectionMultiplexer, DocumentEventMultiplexer, GraphEventMultiplexer

public class EventMultiplexer
extends java.lang.Object
implements EventListenerTag

The event multiplexer base class. This class is extended once per group of events (event package of a certain module). It then implements the different event interfaces for that particular module and offers a convenient way of multiplexing these events.

Version:
$Id: EventMultiplexer.java,v 1.9 2003/08/06 16:37:32 AndreasEbbert Exp $
Author:
Stepan Rutz

Constructor Summary
EventMultiplexer(EventListenerTag a, EventListenerTag b)
          Constructs a new eventmultiplexer that consists of a left and right child.
 
Method Summary
 EventListenerTag a()
          Returns the left node of this multiplex instance.
 EventListenerTag b()
          Returns the right node of this multiplex instance.
static EventListenerTag combine(EventListenerTag a, EventListenerTag b)
          Combines two given eventlisteners to a new eventlistener.
 int countEventListeners()
          Returns the number of eventlisteners that are currently multiplexed by this object.
 java.util.ArrayList listenersToArrayList()
          Creates an arraylist that is filled with all the eventlisteners that are multiplexed by this multiplexer.
static EventListenerTag separate(EventListenerTag a, EventListenerTag b)
          Separates the eventlistener b from the eventlistener a and returns the eventlistener structure.
 java.lang.String toString()
          Returns a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EventMultiplexer

public EventMultiplexer(EventListenerTag a,
                        EventListenerTag b)
Constructs a new eventmultiplexer that consists of a left and right child. The children themselves can be eventmultiplexers as well.

Parameters:
a - left subtree of this eventmultiplexer.
b - right subtree of this eventmultiplexer.
Method Detail

a

public EventListenerTag a()
Returns the left node of this multiplex instance. This method is usually only used by classes that extend this class.

Returns:
the left subtree of this multiplex instance.

b

public EventListenerTag b()
Returns the right node of this multiplex instance. This method is usually only used by classes that extend this class.

Returns:
the right subtree of this multiplex instance.

combine

public static EventListenerTag combine(EventListenerTag a,
                                       EventListenerTag b)
Combines two given eventlisteners to a new eventlistener.

Parameters:
a - the first eventlistener to combine.
b - the second eventlistener to combine.
Returns:
the new eventlistener that combines the two given eventlisteners.

separate

public static EventListenerTag separate(EventListenerTag a,
                                        EventListenerTag b)
Separates the eventlistener b from the eventlistener a and returns the eventlistener structure.

Parameters:
a - the first eventlistener to separate
b - the second eventlistener to separate.
Returns:
the new eventlistener that separates b from a.

countEventListeners

public int countEventListeners()
Returns the number of eventlisteners that are currently multiplexed by this object.

Returns:
number of multiplexed eventlisteners.

listenersToArrayList

public java.util.ArrayList listenersToArrayList()
Creates an arraylist that is filled with all the eventlisteners that are multiplexed by this multiplexer. Usefull for dumping registered events during debugging or similiar.

Returns:
an arraylist fill with all the eventlisteners that are part of this multiplexer.

toString

public java.lang.String toString()
Returns a string representation of this object.

Returns:
a string representation of this object.


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.