Class PerceptionCollectable.Intermediate<I>
java.lang.Object
org.opentrafficsim.road.gtu.lane.perception.PerceptionCollectable.Intermediate<I>
- Type Parameters:
I
- intermediate result type
- Enclosing interface:
- PerceptionCollectable<H extends Headway,
U>
Wrapper of intermediate result with info for the iterator algorithm.
Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel]
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Returns the number of the underlying object currently being accumulated, starts at 0 for the first.Get intermediate object.boolean
isStop()
Method for the iterator to check if it can stop.void
Set intermediate object.void
step()
Method for the iterator to increase the underlying object number.void
stop()
Method for the accumulator to indicate the iterator can stop.
-
Constructor Details
-
Intermediate
Constructor.- Parameters:
object
- I; identity value
-
-
Method Details
-
getObject
Get intermediate object.- Returns:
- I; intermediate object
-
setObject
Set intermediate object.- Parameters:
object
- I; intermediate object
-
getNumber
public int getNumber()Returns the number of the underlying object currently being accumulated, starts at 0 for the first.- Returns:
- int; number of the underlying object currently being accumulated
-
step
public void step()Method for the iterator to increase the underlying object number. -
stop
public void stop()Method for the accumulator to indicate the iterator can stop. -
isStop
public boolean isStop()Method for the iterator to check if it can stop.- Returns:
- boolean; whether the iterator can stop
-