From: Martin D. <mar...@ge...> - 2008-06-02 19:53:40
|
Jody Garnett a écrit : > Cannot actually use a Map; the order of the entries is important; so > SortedMap? or a List<ThreasholdEntry>; Actually a Map can preserve order. This is the case of LinkedHashMap, which can behave just like a List regarding insertion order (minus duplicated keys). The problem with SortedMap is that it requires the definition of a Comparator, and I don't know how we could define a comparator for Expressions. However if we could decide to use an ordinary Map instead and mandate in the javadoc that insertion order must be preserved. It would be a documentation contract without type enforcement however. Martin |