Class EgtfParallelListener

  • All Implemented Interfaces:
    java.util.EventListener, EgtfListener

    public class EgtfParallelListener
    extends java.lang.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 Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Filter getFilter()
      Get the filter results after the EGTF is done.
      void interrupt()
      Interrupts the EGTF.
      void notifyProgress​(EgtfEvent event)
      Notifies progress.
      void setFilter​(Filter filter)
      Set the filter results, this is done by the EGTF.
      java.lang.String toString()
      double wait​(double untilProgress, long timeout)
      Waits until progress has been reached, or timeout was exceeded.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • wait

        public double wait​(double untilProgress,
                           long timeout)
                    throws java.lang.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:
        java.lang.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 java.lang.String toString()
        Overrides:
        toString in class java.lang.Object