Class EventAccumulator<T>

java.lang.Object
VASSAL.tools.concurrent.listener.EventAccumulator<T>
All Implemented Interfaces:
EventListener<T>

public class EventAccumulator<T> extends Object implements EventListener<T>
An EventListener which accumulates the events it receives into a List.
Since:
3.2.0
Author:
Joel Uckelman
  • Field Details

  • Constructor Details

    • EventAccumulator

      public EventAccumulator()
    • EventAccumulator

      public EventAccumulator(Collection<Pair<Object,​T>> col)
  • Method Details

    • receive

      public void receive(Object src, T event)
      Receive notification of an event.
      Specified by:
      receive in interface EventListener<T>
      Parameters:
      src - the source of the event
      event - the event
    • events

      public Collection<Pair<Object,​T>> events()
      Gets the collection of received source-event pairs.
      Returns:
      the collection of sources and events received