Class AbstractPerceptionReiterable<H extends Headway,​U>

  • Type Parameters:
    H - headway type
    U - underlying object type
    All Implemented Interfaces:
    Iterable<H>, PerceptionCollectable<H,​U>, PerceptionIterable<H>
    Direct Known Subclasses:
    AbstractPerceptionIterable, MultiLanePerceptionIterable

    public abstract class AbstractPerceptionReiterable<H extends Headway,​U>
    extends Object
    implements PerceptionCollectable<H,​U>
    This class uses a single primary iterator which a subclass defines, and makes sure that all elements are only looked up and created once. It does so by storing the elements in a linked list. All calls to iterator() return an iterator which iterates over the linked list. If an iterator runs to the end of the linked list, the primary iterator is requested to add an element if it has one.

    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 20 feb. 2018
    Author:
    Alexander Verbraeck, Peter Knoppers, Wouter Schakel