# Class AbstractSelection<E>

java.lang.Object
com.macrofocus.common.selection.AbstractSelection<E>

All Implemented Interfaces:
  `Selection<E>, Iterable<E>`

Direct Known Subclasses:
  `AbstractMutableSelection`

public abstract class AbstractSelection<E> extends Object implements Selection<E>
This class provides a skeletal implementation of the Selection interface to minimize the effort required to implement this interface.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AbstractSelection()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addSelectionListener(SelectionListener<E> listener)`
  Add a listener to the list that's notified each time a change to the selection occurs.
  `void`
  `addWeakSelectionListener(SelectionListener<E> listener)`
  Add a listener to the list that's notified each time a change to the selection occurs.
  `boolean`
  `isEnabled()`
  `protected void`
  `notifySelectedChanged(SelectionEvent<E> event)`
  `void`
  `removeSelectionListener(SelectionListener<E> listener)`
  Remove a listener to the list that's notified each time a change to the selection occurs.
  `void`
  `removeSelectionListeners()`
  Remove all listeners to the list that's notified each time a change to the selection occurs.
  `protected void`
  `setEnabled(boolean enabled)`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface Iterable

  `forEach, iterator, spliterator`

  ### Methods inherited from interface Selection

  `getSelectedCount, getSelectedSet, isActive, isSelected`

- ## Constructor Details

  - ### AbstractSelection

    public AbstractSelection()

- ## Method Details

  - ### isEnabled

    public boolean isEnabled()
    Specified by:
      `isEnabled` in interface `Selection<E>`

  - ### setEnabled

    protected void setEnabled(boolean enabled)

  - ### addSelectionListener

    public void addSelectionListener(SelectionListener<E> listener)
    Description copied from interface: `Selection`
    Add a listener to the list that's notified each time a change to the selection occurs.
    Specified by:
      `addSelectionListener` in interface `Selection<E>`
    Parameters:
      `listener` - the SelectionListener

  - ### addWeakSelectionListener

    public void addWeakSelectionListener(SelectionListener<E> listener)
    Description copied from interface: `Selection`
    Add a listener to the list that's notified each time a change to the selection occurs. The listener will automatically be disposed of should no other object have a reference to it.
    Specified by:
      `addWeakSelectionListener` in interface `Selection<E>`
    Parameters:
      `listener` - the SelectionListener

  - ### removeSelectionListener

    public void removeSelectionListener(SelectionListener<E> listener)
    Description copied from interface: `Selection`
    Remove a listener to the list that's notified each time a change to the selection occurs.
    Specified by:
      `removeSelectionListener` in interface `Selection<E>`
    Parameters:
      `listener` - the SelectionListener

  - ### removeSelectionListeners

    public void removeSelectionListeners()
    Description copied from interface: `Selection`
    Remove all listeners to the list that's notified each time a change to the selection occurs.
    Specified by:
      `removeSelectionListeners` in interface `Selection<E>`

  - ### notifySelectedChanged

    protected void notifySelectedChanged(SelectionEvent<E> event)