Path: csiph.com!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail From: Jan Burse Newsgroups: comp.lang.java.programmer Subject: Re: Glitch in Java Collections (No descendingMap in LinkedHashMap) Date: Fri, 05 Oct 2012 20:18:58 +0200 Organization: albasani.net Lines: 32 Message-ID: References: <0fca6c33-cce6-410e-a8c9-cf503969a9ff@googlegroups.com> <8603e8f1-5c24-432a-b42a-540b44f8c577@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.albasani.net o3DYrN73d1cSsN2lZZhfJQztpVlI5LDpnd5Wa5R/9zJM/y1cpFzViATCp4iXAAtSblHplAvgyI+cp5tlnLqibm1KjW5jZxUJdK1fsCjdBv+jvI5ABaQjFWfgV1RWx4hn NNTP-Posting-Date: Fri, 5 Oct 2012 18:18:51 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="iLHUphFSFhg6hSZzLVTYvPJRByMNKQtfH1oyV+B9YNsDG9Wzlk9UFsrGTvssxqeqa7CHZGvZoufC1I02W5G2YRBcnvxr7wCqe2sbZcka5nTGcb6OPPQxvBBL7JhsbDBp"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120909 Firefox/15.0.1 SeaMonkey/2.12.1 In-Reply-To: <8603e8f1-5c24-432a-b42a-540b44f8c577@googlegroups.com> Cancel-Lock: sha1:AdfJ0hK85GsCatNi5xK7Z4YUCOc= Xref: csiph.com comp.lang.java.programmer:19138 Lew schrieb: >> There are some use cases described in the class JavaDoc. > It doesn't explain how you reveal the order, Java doc that only shows public entries does indeed not help, since the magic happens in a package local method. From HashMap: // Subclass overrides these to alter behavior of views' iterator() method Iterator newKeyIterator() { return new KeyIterator(); } Iterator newValueIterator() { return new ValueIterator(); } Iterator> newEntryIterator() { return new EntryIterator(); } From LinkedHashMap: // These Overrides alter the behavior of superclass view iterator() methods Iterator newKeyIterator() { return new KeyIterator(); } Iterator newValueIterator() { return new ValueIterator(); } Iterator> newEntryIterator() { return new EntryIterator(); }