H
- headway typeU
- underlying object typepublic abstract class AbstractPerceptionReiterable<H extends Headway,U> extends Object implements PerceptionCollectable<H,U>
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-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
Modifier and Type | Class and Description |
---|---|
class |
AbstractPerceptionReiterable.PerceptionIterator
This iterator is returned to callers of the
iterator() method. |
protected class |
AbstractPerceptionReiterable.PrimaryIteratorEntry
Class for
primaryIterator() to return, implemented in subclasses. |
PerceptionCollectable.Intermediate<I>, PerceptionCollectable.PerceptionAccumulator<U,I>, PerceptionCollectable.PerceptionCollector<C,U,I>, PerceptionCollectable.PerceptionFinalizer<C,I>
Modifier | Constructor and Description |
---|---|
protected |
AbstractPerceptionReiterable(LaneBasedGTU perceivingGtu)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
<C,I> C |
collect(Supplier<I> identity,
PerceptionCollectable.PerceptionAccumulator<? super U,I> accumulator,
PerceptionCollectable.PerceptionFinalizer<C,I> finalizer)
Collect the underlying objects in to a perceived result.
|
H |
first()
Returns the first element.
|
boolean |
isEmpty()
Returns whether this iterable is empty.
|
Iterator<H> |
iterator() |
protected abstract H |
perceive(LaneBasedGTU perceivingGtu,
U object,
Length distance)
Returns a perceived version of the underlying object.
|
protected abstract Iterator<AbstractPerceptionReiterable.PrimaryIteratorEntry> |
primaryIterator()
Returns the primary iterator.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
collect
forEach, spliterator
protected AbstractPerceptionReiterable(LaneBasedGTU perceivingGtu)
perceivingGtu
- LaneBasedGTU; perceiving GTUprotected abstract Iterator<AbstractPerceptionReiterable.PrimaryIteratorEntry> primaryIterator()
protected abstract H perceive(LaneBasedGTU perceivingGtu, U object, Length distance) throws GTUException, ParameterException
perceivingGtu
- LaneBasedGTU; perceiving GTUobject
- U; underlying objectdistance
- Length; distance to the objectGTUException
- on exceptionParameterException
- on invalid parameter value or missing parameterpublic final H first()
first
in interface PerceptionIterable<H extends Headway>
public final boolean isEmpty()
isEmpty
in interface PerceptionIterable<H extends Headway>
public final <C,I> C collect(Supplier<I> identity, PerceptionCollectable.PerceptionAccumulator<? super U,I> accumulator, PerceptionCollectable.PerceptionFinalizer<C,I> finalizer)
collect
in interface PerceptionCollectable<H extends Headway,U>
C
- collection result typeI
- intermediate typeidentity
- Supplier<I>; the initial intermediate result valueaccumulator
- PerceptionAccumulator<? super U, I>; accumulatorfinalizer
- PerceptionFinalizer<C, I>; finalizerCopyright © 2014–2019 Delft University of Technology. All rights reserved.