ArrayMap is optimized for many-reads-few-write. In particular, it reallocates its array on any insertion or deletion.
ArrayMap also includes a series of static methods for managing the Object array. These may be used in place of instantiating an ArrayMap for clients that don't need a Map implementation. Clients using these methods must be careful to store the returned Object array on any mutator method. They also must provide their own synchronization, if needed. When using these static methods, clients can opt to search for objects by identity (via getByIdentity()
) instead of equality, while the static get()
method will try identity before equality. This latter approach is extremely fast but still safe for retrieval of Strings that have all been interned, especially if misses are infrequent (since misses do require a scan using Object.equals()). It's worth remembering that String constants are always interned, as required by the language specification.
@version $Name: $ ($Revision: adfrt/faces/adf-faces-api/src/main/java/oracle/adf/view/faces/util/ArrayMap.java#0 $) $Date: 10-nov-2005.19:08:36 $
|
|
|
|
|
|