org.simantics.databoard.accessor.impl
Class EventCollection

java.lang.Object
  extended by org.simantics.databoard.accessor.impl.EventCollection
All Implemented Interfaces:
Accessor.Listener

public class EventCollection
extends java.lang.Object
implements Accessor.Listener

Event Collection is a Accessor.Listener implementation that collects events.

Author:
Toni Kalajainen
See Also:
ModificationEvent

Field Summary
 java.util.List<Event> events
           
 
Constructor Summary
EventCollection()
           
 
Method Summary
 void addEvent(Event event)
           
 void addEvents(java.util.Collection<Event> events)
           
 void clear()
           
 java.util.List<Event> getAndClearEvents()
          Returns events and clears change set.
 java.util.List<Event> getEvents()
          Get a snapshot of events.
 boolean isEmpty()
           
 void onEvents(java.util.Collection<Event> events)
          Notify the listener on a new event
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

events

public java.util.List<Event> events
Constructor Detail

EventCollection

public EventCollection()
Method Detail

addEvent

public void addEvent(Event event)

addEvents

public void addEvents(java.util.Collection<Event> events)

getAndClearEvents

public java.util.List<Event> getAndClearEvents()
Returns events and clears change set.

Returns:
the list of events

isEmpty

public boolean isEmpty()

getEvents

public java.util.List<Event> getEvents()
Get a snapshot of events.

Returns:
a copy of events

onEvents

public void onEvents(java.util.Collection<Event> events)
Description copied from interface: Accessor.Listener
Notify the listener on a new event

Specified by:
onEvents in interface Accessor.Listener

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

clear

public void clear()