Package org.djutils.event.collection
Class EventProducingMap<K,V> 
java.lang.Object
org.djutils.event.LocalEventProducer
org.djutils.event.collection.EventProducingMap<K,V> 
- Type Parameters:
- K- the key type
- V- the value type
- All Implemented Interfaces:
- Map<K,,- V> - EventProducer
The Event producing map provides a map to which one can subscribe interest in entry changes. This class does not keep track
 of changes which take place indirectly. One is for example not notified on 
map.iterator.remove(). A listener
 must subscribe to the iterator, key set, etc. individually.
 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
- 
Nested Class Summary
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final EventTypeOBJECT_ADDED_EVENT is fired on new entries.static final EventTypeOBJECT_CHANGED_EVENT is fired on change of one or more entries.static final EventTypeOBJECT_REMOVED_EVENT is fired on removal of entries.Fields inherited from interface org.djutils.event.EventProducerFIRST_POSITION, LAST_POSITION
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidclear()booleancontainsKey(Object key) booleancontainsValue(Object value) entrySet()booleanisEmpty()keySet()voidintsize()values()Methods inherited from class org.djutils.event.LocalEventProducergetEventListenerMapMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.djutils.event.EventProduceraddListener, 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.Mapcompute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
- 
Field Details- 
OBJECT_ADDED_EVENTOBJECT_ADDED_EVENT is fired on new entries.
- 
OBJECT_REMOVED_EVENTOBJECT_REMOVED_EVENT is fired on removal of entries.
- 
OBJECT_CHANGED_EVENTOBJECT_CHANGED_EVENT is fired on change of one or more entries.
 
- 
- 
Constructor Details- 
EventProducingMapconstructs a new EventProducingMap.- Parameters:
- wrappedMap- the embedded map.
 
 
- 
- 
Method Details- 
sizepublic int size()
- 
isEmptypublic boolean isEmpty()
- 
containsKey- Specified by:
- containsKeyin interface- Map<K,- V> 
 
- 
containsValue- Specified by:
- containsValuein interface- Map<K,- V> 
 
- 
get
- 
put
- 
remove
- 
putAll
- 
clearpublic void clear()
- 
keySet
- 
values
- 
entrySet
 
-