Class GraphUpdater<T>

  • Type Parameters:
    T - type of value in queue

    public class GraphUpdater<T>
    extends java.lang.Object
    The GrapghUpdater can be used to repeatedly offer a value that is automatically processed in order of offering in a parallel Thread.

    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 13 okt. 2018
    Author:
    Alexander Verbraeck, Peter Knoppers, Wouter Schakel
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void offer​(T t)
      Offer a next value to the queue.
      java.lang.String toString()
      • Methods inherited from class java.lang.Object

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

      • GraphUpdater

        public GraphUpdater​(java.lang.String workerName,
                            java.lang.Thread invokingThread,
                            org.opentrafficsim.draw.graphs.GraphUpdater.Updater<T> updater)
        Constructs and starts a thread that performs each given task from a queue.
        Parameters:
        workerName - String; name for the working thread
        invokingThread - Thread; invoking thread, the worker will stop when this thread is interrupted
        updater - Updater<T>; updater to perform with the queued value
    • Method Detail

      • offer

        public final void offer​(T t)
        Offer a next value to the queue.
        Parameters:
        t - T; next value to offer to the queue
      • toString

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