Class SortedSetPerceptionIterable<H extends Headway>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractSet<E>
-
- java.util.TreeSet<H>
-
- org.opentrafficsim.road.gtu.lane.perception.SortedSetPerceptionIterable<H>
-
- Type Parameters:
H
- headway type
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<H>
,Collection<H>
,NavigableSet<H>
,Set<H>
,SortedSet<H>
,PerceptionCollectable<H,LaneBasedGTU>
,PerceptionIterable<H>
@Deprecated public class SortedSetPerceptionIterable<H extends Headway> extends TreeSet<H> implements PerceptionCollectable<H,LaneBasedGTU>
Deprecated.Simple class implementing a SortedSet. This is mainly for backwards compatibility. Methods that determine the elements 1-by-1 are much preferred for efficiency.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 19 feb. 2018
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.opentrafficsim.road.gtu.lane.perception.PerceptionCollectable
PerceptionCollectable.Intermediate<I>, PerceptionCollectable.PerceptionAccumulator<U,I>, PerceptionCollectable.PerceptionCollector<C,U,I>, PerceptionCollectable.PerceptionFinalizer<C,I>, PerceptionCollectable.UnderlyingDistance<U>
-
-
Constructor Summary
Constructors Constructor Description SortedSetPerceptionIterable(OTSRoadNetwork otsNetwork)
Deprecated.Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description <C,I>
Ccollect(Supplier<I> identity, PerceptionCollectable.PerceptionAccumulator<? super LaneBasedGTU,I> accumulator, PerceptionCollectable.PerceptionFinalizer<C,I> finalizer)
Deprecated.Collect the underlying objects in to a perceived result.Iterator<LaneBasedGTU>
underlying()
Deprecated.Returns an iterator over the underlying objects.Iterator<PerceptionCollectable.UnderlyingDistance<LaneBasedGTU>>
underlyingWithDistance()
Deprecated.Returns an iterator over the underlying objects coupled with the distance.-
Methods inherited from class java.util.TreeSet
add, addAll, ceiling, clear, clone, comparator, contains, descendingIterator, descendingSet, first, floor, headSet, headSet, higher, isEmpty, iterator, last, lower, pollFirst, pollLast, remove, size, spliterator, subSet, subSet, tailSet, tailSet
-
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
-
Methods inherited from class java.util.AbstractCollection
containsAll, retainAll, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface org.opentrafficsim.road.gtu.lane.perception.PerceptionCollectable
collect
-
Methods inherited from interface org.opentrafficsim.road.gtu.lane.perception.PerceptionIterable
first, isEmpty
-
-
-
-
Constructor Detail
-
SortedSetPerceptionIterable
public SortedSetPerceptionIterable(OTSRoadNetwork otsNetwork)
Deprecated.Constructor.- Parameters:
otsNetwork
- OTSRoadNetwork; network to obtain LaneBasedGTU
-
-
Method Detail
-
collect
public <C,I> C collect(Supplier<I> identity, PerceptionCollectable.PerceptionAccumulator<? super LaneBasedGTU,I> accumulator, PerceptionCollectable.PerceptionFinalizer<C,I> finalizer)
Deprecated.Collect the underlying objects in to a perceived result. This methodology is loosely based on Stream.collect().- Specified by:
collect
in interfacePerceptionCollectable<H extends Headway,LaneBasedGTU>
- Type Parameters:
C
- collection result typeI
- intermediate type- Parameters:
identity
- Supplier<I>; the initial intermediate result valueaccumulator
- PerceptionAccumulator<? super U, I>; accumulatorfinalizer
- PerceptionFinalizer<C, I>; finalizer- Returns:
- C; collection result
-
underlying
public Iterator<LaneBasedGTU> underlying()
Deprecated.Returns an iterator over the underlying objects.- Specified by:
underlying
in interfacePerceptionCollectable<H extends Headway,LaneBasedGTU>
- Returns:
- Iterator<U>; iterator
-
underlyingWithDistance
public Iterator<PerceptionCollectable.UnderlyingDistance<LaneBasedGTU>> underlyingWithDistance()
Deprecated.Returns an iterator over the underlying objects coupled with the distance.- Specified by:
underlyingWithDistance
in interfacePerceptionCollectable<H extends Headway,LaneBasedGTU>
- Returns:
- Iterator<UnderlyingDistance<U>>; iterator
-
-