Class ScriptEventsIterator

java.lang.Object
org.eclipse.tracecompass.incubator.scripting.core.trace.ScriptEventsIterator
All Implemented Interfaces:
Iterator<ITmfEvent>

public class ScriptEventsIterator extends Object implements Iterator<ITmfEvent>
An event iterator class for scripting which allows to return to the script only the requested events, by setting the desired event names with the addEvent(String) method. If no event is added, all events will be returned.
Author:
Geneviève Bastien
  • Constructor Details

    • ScriptEventsIterator

      public ScriptEventsIterator(BufferedBlockingQueue<ITmfEvent> eventsQueue)
      Constructor
      Parameters:
      eventsQueue - The blocking queue from which to get the events
  • Method Details

    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<ITmfEvent>
    • addEvent

      public void addEvent(String eventName)
      Add an event name to the list of events to return. Once an event has been added to this iterator, only those events will be returned.

      To return multiple events, this method can be called multiple times, once for each event.

      Parameters:
      eventName - The name of the event to return
    • next

      public ITmfEvent next()
      Specified by:
      next in interface Iterator<ITmfEvent>