Package ca.odell.glazedlists
Interface DisposableMap<K,V>
-
- All Superinterfaces:
java.util.Map<K,V>
public interface DisposableMap<K,V> extends java.util.Map<K,V>
A special kind of Map backed by an EventList that is expected to live longer than this Map. It defines adispose()
method which should be called when the Map is no longer useful, but the underlyingEventList
is still referenced and useful. It allows this Map to be garbage collected before its sourceEventList
.- Author:
- James Lemieux
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
dispose()
Releases the resources consumed by thisDisposableMap
so that it may eventually be garbage collected.
-
-
-
Method Detail
-
dispose
void dispose()
Releases the resources consumed by thisDisposableMap
so that it may eventually be garbage collected.A
DisposableMap
will be garbage collected without a call todispose()
, but not before its sourceEventList
is garbage collected. By callingdispose()
, you allow theDisposableMap
to be garbage collected before its sourceEventList
. This is necessary for situations where aDisposableMap
is short-lived but its sourceEventList
is long-lived.Warning: It is an error to call any method on a
DisposableMap
after it has been disposed.
-
-