Package org.opentrafficsim.core.egtf
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-2022 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
-
-
Constructor Summary
Constructors Constructor Description EgtfParallelListener()
Package-private constructor.
-
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.String
toString()
double
wait(double untilProgress, long timeout)
Waits until progress has been reached, or timeout was exceeded.
-
-
-
Method Detail
-
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 untiltimeout
- 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 interfaceEgtfListener
- Parameters:
event
- EgtfEvent; event
-
interrupt
public void interrupt()
Interrupts the EGTF.
-
-