This kind of implementation detail should be hidden from the consumer
application. If Jame's AttributeList interface were used, the String
get(String) method could be made more efficient through alphabetical
sorting, as you suggest. This would, however, require that the attributes be
sorted in the first place, so with any significant number of attributes it
might be more efficient to instantiate an iterator on a map than to sort the
attributes. Of course, the map insert probably has log complexity instead of
constant for the list...
When you get down to it, we need an iterator-type interface and a map-type
interface. The area of controversy seems to be whether these are both
provided on top of one implementation, or whether a new implementation is
instantiated for the iteration interface. I personally prefer the second
variant but I guess it doesn't matter much.
Matthew