Class EgtfParallelListener

java.lang.Object
org.opentrafficsim.core.egtf.EgtfParallelListener
All Implemented Interfaces:
EventListener, EgtfListener

public class EgtfParallelListener
extends Object
implements EgtfListener
Listener that allows another thread to monitor, report on, and wait for the filtering result.

Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.

Version:
$Revision$, $LastChangedDate$, by $Author$, initial version 24 okt. 2018
Author:
Wouter Schakel
  • Method Details

    • wait

      public double wait​(double untilProgress, long timeout) throws InterruptedException
      Waits until progress has been reached, or timeout was exceeded.
      Parameters:
      untilProgress - double; progress to wait until
      timeout - long; time out in milliseconds
      Returns:
      double; value equal to or above untilProgress, or lower if the timeout was exceeded
      Throws:
      InterruptedException - when the calling thread is interrupted
    • setFilter

      public void setFilter​(Filter filter)
      Set the filter results, this is done by the EGTF.
      Parameters:
      filter - Filter; filter results
    • getFilter

      public Filter getFilter()
      Get the filter results after the EGTF is done.
      Returns:
      Filter; filter results
    • notifyProgress

      public void notifyProgress​(EgtfEvent event)
      Notifies progress.
      Specified by:
      notifyProgress in interface EgtfListener
      Parameters:
      event - EgtfEvent; event
    • interrupt

      public void interrupt()
      Interrupts the EGTF.
    • toString

      public String toString()
      Overrides:
      toString in class Object