Unlike Maps:
A NamedList provides fast access by element number, but not by name.
When a NamedList is serialized, order is considered more important than access by key, so ResponseWriters that output to a format such as JSON will normally choose a data structure that allows order to be easily preserved in various clients (i.e. not a straight map). If access by key is more important, see {@link SimpleOrderedMap}, or simply use a regular {@link Map}
@version $Id: NamedList.java 1065312 2011-01-30 16:08:25Z rmuir $This class is biased towards sequential accesses. If it is used with name lookups, the list should be small. It is implemented as a linked list rather than hash table to preserve ordering information, and thus would not provide efficient name lookup for large lists. Also, it permits the name of an object in the list to change without this list being informed.
An instance of this class may have a container, but that container is only used for error reporting. @author Mudit Goel, Edward A. Lee @version $Id: NamedList.java,v 1.53 2005/07/08 19:59:18 cxh Exp $ @since Ptolemy II 0.2 @Pt.ProposedRating Green (eal) @Pt.AcceptedRating Green (johnr) @see Nameable
|
|
|
|
|
|