Package org.djutils.event.collection
Class EventProducingIterator<T>
java.lang.Object
org.djutils.event.LocalEventProducer
org.djutils.event.collection.EventProducingIterator<T>
- Type Parameters:
T- the type of elements to iterate on
- All Implemented Interfaces:
Iterator<T>,EventProducer
- Direct Known Subclasses:
EventProducingListIterator
The EventProducingIterator provides an iterator embedding the Iterator, which fires an event when an object has been removed.
Note that one does not have to subscribe specifically to the events of the EventProducingIterator, as the EventProducing
collection subscribes to the EventProducingIterator's remove events and fires these again to its subscribers.
Copyright (c) 2002-2025 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://djutils.org. The DJUTILS project is distributed under a three-clause BSD-style license, which can be found at https://djutils.org/docs/license.html. This class was originally part of the DSOL project, see https://simulation.tudelft.nl/dsol/manual.
- Author:
- Peter Jacobs , Alexander Verbraeck
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final EventTypeOBJECT_REMOVED_EVENT is fired on removal of entries.Fields inherited from interface org.djutils.event.EventProducer
FIRST_POSITION, LAST_POSITION -
Constructor Summary
ConstructorsConstructorDescriptionEventProducingIterator(Iterator<T> wrappedIterator) constructs a new EventProducingIterator, embedding the parent Iterator. -
Method Summary
Methods inherited from class org.djutils.event.LocalEventProducer
getEventListenerMapMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.djutils.event.EventProducer
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, getEventTypesWithListeners, getListenerReferences, hasListeners, numberOfListeners, removeAllListeners, removeAllListeners, removeListenerMethods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
OBJECT_REMOVED_EVENT
OBJECT_REMOVED_EVENT is fired on removal of entries.
-
-
Constructor Details
-
EventProducingIterator
constructs a new EventProducingIterator, embedding the parent Iterator.- Parameters:
wrappedIterator- parent.
-
-
Method Details