Package org.djutils.event.collection
Class EventProducingListIterator<T>
java.lang.Object
org.djutils.event.LocalEventProducer
org.djutils.event.collection.EventProducingIterator<T>
org.djutils.event.collection.EventProducingListIterator<T>
- Type Parameters:
T- the type of elements to iterate on
- All Implemented Interfaces:
Serializable,Remote,Iterator<T>,ListIterator<T>,EventProducer
public class EventProducingListIterator<T>
extends EventProducingIterator<T>
implements ListIterator<T>, Serializable
EventProducingListIterator provides an iterator embedding the ListIterator, which fires an event when an object has been
removed. Note that one does not have to subscribe specifically to the events of the EventProducingListIterator, as the
EventProducing collection subscribes to the EventProducingListIterator'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:
- Alexander Verbraeck
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final EventTypeOBJECT_ADDED_EVENT is fired on adding of entries.static final EventTypeOBJECT_CHANGED_EVENT is fired on changing of entries.Fields inherited from class org.djutils.event.collection.EventProducingIterator
OBJECT_REMOVED_EVENTFields inherited from interface org.djutils.event.EventProducer
FIRST_POSITION, LAST_POSITION -
Constructor Summary
ConstructorsConstructorDescriptionEventProducingListIterator(ListIterator<T> wrappedIterator) constructs a new EventProducingListIterator, embedding the parent ListIterator. -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected ListIterator<T>Return the embedded iterator.booleanintprevious()intvoidMethods inherited from class org.djutils.event.collection.EventProducingIterator
hasNext, next, removeMethods inherited from class org.djutils.event.LocalEventProducer
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, getEventListenerMap, getEventTypesWithListeners, getListenerReferences, hasListeners, numberOfListeners, removeAllListeners, removeAllListeners, removeListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemainingMethods inherited from interface java.util.ListIterator
hasNext, next, remove
-
Field Details
-
OBJECT_ADDED_EVENT
OBJECT_ADDED_EVENT is fired on adding of entries. -
OBJECT_CHANGED_EVENT
OBJECT_CHANGED_EVENT is fired on changing of entries.
-
-
Constructor Details
-
EventProducingListIterator
constructs a new EventProducingListIterator, embedding the parent ListIterator.- Parameters:
wrappedIterator- embedded iterator.
-
-
Method Details
-
getWrappedIterator
Description copied from class:EventProducingIteratorReturn the embedded iterator.- Overrides:
getWrappedIteratorin classEventProducingIterator<T>- Returns:
- the embedded iterator
-
hasPrevious
public boolean hasPrevious()- Specified by:
hasPreviousin interfaceListIterator<T>
-
previous
- Specified by:
previousin interfaceListIterator<T>
-
nextIndex
public int nextIndex()- Specified by:
nextIndexin interfaceListIterator<T>
-
previousIndex
public int previousIndex()- Specified by:
previousIndexin interfaceListIterator<T>
-
set
- Specified by:
setin interfaceListIterator<T>
-
add
- Specified by:
addin interfaceListIterator<T>
-