Implements ValueCoder, ValueRenderer and ValueDisplayer for selected classes in the Java Collections API. By default an instance of this coder is registered for each of the following concrete classes:
The stored data consist only of items accessible through the Collection
or Map
interfaces. For example, implementation details such as the current loadFactor for a HashMap
are not stored. For any Collection
(including List
and Set
), the stored format is simply a list of all the values in the order returned by an Iterator
. For a Map
the stored format is simply a key/value pair for each entry in the order returned by the Iterator
returned by the entrySet()
method of the Map
.
Because customer-written Collection
and Map
implementations may contain additional internal state that may also need to be stored when they are serialized, this coder is registered only for specific implementations provided by the JRE. You may register and use this ValueCoder for any custom Collection
or Map
that does not need to serialize additional data.
Note that for ArrayList
, Vector
, Stack
, and other List
implementations that do not extend AbstractSequentialList
, the serialization logic uses the get(index)
method of List
to acquire each member rather than constructing an Iterator
. Subclasses of AbstractSequentialList
are serialized by using an Iterator
because access by index may be inefficient.
|
|
|
|
|
|