Class ALcdWeakSelectionListener<T>

java.lang.Object
com.luciad.util.ALcdWeakSelectionListener<T>
Type Parameters:
T - The type of the short-lived object
All Implemented Interfaces:
ILcdSelectionListener, Serializable, EventListener

public abstract class ALcdWeakSelectionListener<T> extends Object implements ILcdSelectionListener

A ILcdSelectionListener implementation which only keeps a WeakReference to the object it wants to update when selection changes are received. This avoids memory leaks, even without removing the listener.

The class javadoc of ALcdWeakModelListener contains an example of a weak listener, and some rules on the usage of weak listeners.

This particular listener has two extra rules compared to the general rules of weak listeners:

  • The object to listen to must implement ILcdSelection.
  • The listener must be registered using ILcdSelection#addSelectionListener.

Since:
2015.1
See Also:
  • Constructor Details

    • ALcdWeakSelectionListener

      protected ALcdWeakSelectionListener(T aObjectToModify)

      Creates a new ALcdWeakSelectionListener instance which can update aObjectToModify when it receives events.

      Parameters:
      aObjectToModify - The object you want to modify when a TLcdSelectionChangedEvent is received. This is a short-lived object, while the listener will be attached to a long-living ILcdSelection object.
  • Method Details