com.levigo.util.base.glazedlists
Interface DisposableMap<K,V>

All Superinterfaces:
Map<K,V>

public interface DisposableMap<K,V>
extends Map<K,V>

A special kind of Map backed by an EventList that is expected to live longer than this Map. It defines a dispose() method which should be called when the Map is no longer useful, but the underlying EventList is still referenced and useful. It allows this Map to be garbage collected before its source EventList.

Author:
James Lemieux

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Method Summary
 void dispose()
          Releases the resources consumed by this DisposableMap so that it may eventually be garbage collected.
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 

Method Detail

dispose

void dispose()
Releases the resources consumed by this DisposableMap so that it may eventually be garbage collected.

A DisposableMap will be garbage collected without a call to dispose(), but not before its source EventList is garbage collected. By calling dispose(), you allow the DisposableMap to be garbage collected before its source EventList. This is necessary for situations where a DisposableMap is short-lived but its source EventList is long-lived.

Warning: It is an error to call any method on a DisposableMap after it has been disposed.



Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.