Skip navigation links

Package org.opentrafficsim.core.perception.collections

Historical versions of almost all java non-concurrent collections.

See: Description

Package org.opentrafficsim.core.perception.collections Description

Historical versions of almost all java non-concurrent collections. ArrayDeque is not supported as it does not allow reversal of it's state. No implementation for IdentityHashMap is provided as it only has very specific use-cases that are not in line with historical states. Of the legacy collections only Vector has an implementation.

This package adds to each of the collections a get() and a get(Time) method. The get() returns a shallow copy of the current contents, while get(Time) constructs past contents by working from the current content backwards in time. To be able to do this, events are maintained for each change to the collection. This means that all changes have to go through a specific process.

There is no backing-up of provided views on collections. Subsets, key sets, value sets, etc. are hence unmodifiable. Also iterators do not allow the collection to be altered. The reason for these actions not being supported is that there is no way to trigger events upon changes to these sets and by iterators. All changes must be made directly on the collection.

Implementations in this package use 1 or 2 event types, generally for adding and removing an element. More advanced operations, such as addAll() are translated into events per individual element.

Some of the interface (HistoricalCollection, HistoricalList, HistoricalMap) override default implementations with other default implementations, as the original default methods use unsupported features (Iterator.remove(), ListIterator.set(E), Map.Entry.setValue(V)).

Copyright (c) 2013-2018 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 3 feb. 2018
Author:
Alexander Verbraeck, Peter Knoppers, Wouter Schakel
Skip navigation links

Copyright © 2014–2018 Delft University of Technology. All rights reserved.