This class represents adaptions of Java Collections Framework
maps to primitive maps from object values to boolean values.
The adapter is implemented as a wrapper around the map.
Thus, changes to the underlying map are reflected by this
map and vice versa.
Adapters from JCF maps to primitive map will
fail if the JCF collection contains null values or
values of the wrong class. However, adapters are not fast
failing in the case that the underlying map should
contain illegal keys or values. To implement fast failure would require
every operation to check every key and value of the underlying
map before doing anything. Instead validation methods
are provided. They can be called using the assertion facility
in the client code:
MapToObjectKeyBooleanMapAdapter s;
...
assert s.validate();
or by letting the adapter throw an exception on illegal values:
MapToObjectKeyBooleanMapAdapter s;
...
s.evalidate(); // Throws an exception on illegal values
Either way, validation must be invoked directly by the client
code.
author: Søren Bak version: 1.1 21-08-2003 19:12 since: 1.1 |