java.util.Map interface that has a serialized form consistent in all virtual machines. ConsistentMap instances are unmodifiable. All mutator methods, such as add and remove, throw UnsupportedOperationException. This class permits null values and the null key. Although instances of this class are unmodifiable, they are not necessarily immutable. If a client retrieves a mutable object (either a key or value) contained in a ConsistentMap and mutates that object, the client in effect mutates the state of the ConsistentMap. In this case, the serialized form of the ConsistentMap will most likely also have been mutated. A ConsistentMap that contains only immutable objects will maintain a consistent serialized form indefinitely. But a ConsistentMap that contains mutable objects will maintain a consistent serialized form only so long as the mutable objects are not mutated.
@author Bill Venners
| |