imx.lib.listener
Class ActiveClassMap

java.lang.Object
  extended by imx.lib.listener.ActiveClassMap
All Implemented Interfaces:
ActiveInterface, java.io.Serializable

public class ActiveClassMap
extends java.lang.Object
implements java.io.Serializable, ActiveInterface

This Map associates objects with a class. If for a class no object is stored the object of the superclass is returned. If no super class has an associated object, the object stored for null is returned (aka the default object). The map updates any registered listener after it changed.

See Also:
Serialized Form

Constructor Summary
ActiveClassMap()
           
 
Method Summary
 void addListener(ListenerInterface listener, java.lang.Object eventType)
          As a convention, if the eventType is null, the listener must be registered to all eventTypes.
 void clear()
           
 java.lang.Object getObject(java.lang.Class objectClass)
          searches for the object associated with objectClass.
 java.lang.Object getObject(java.lang.Object obj)
          searches for the object associated with the class of obj.
 void removeListener(ListenerInterface listener, java.lang.Object eventType)
          If eventType is null, the listener is removed from all event types.
 void setObject(java.lang.Class objectClass, java.lang.Object obj)
          Associates obj with the class objectClass.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActiveClassMap

public ActiveClassMap()
Method Detail

getObject

public java.lang.Object getObject(java.lang.Class objectClass)
searches for the object associated with objectClass.


getObject

public java.lang.Object getObject(java.lang.Object obj)
searches for the object associated with the class of obj.


setObject

public void setObject(java.lang.Class objectClass,
                      java.lang.Object obj)
Associates obj with the class objectClass. If any listeners are registered, they are called after this method.


clear

public void clear()

addListener

public void addListener(ListenerInterface listener,
                        java.lang.Object eventType)
Description copied from interface: ActiveInterface
As a convention, if the eventType is null, the listener must be registered to all eventTypes.

Specified by:
addListener in interface ActiveInterface
Parameters:
listener - must not be null
eventType - null means register to all events
See Also:
ListenerInterface

removeListener

public void removeListener(ListenerInterface listener,
                           java.lang.Object eventType)
Description copied from interface: ActiveInterface
If eventType is null, the listener is removed from all event types.

Specified by:
removeListener in interface ActiveInterface
Parameters:
listener - must not be null
eventType - can be null
See Also:
ListenerInterface