Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: markspace Newsgroups: comp.lang.java.programmer Subject: Re: Queue and Map interface Date: Fri, 13 Jun 2014 16:52:46 -0700 Organization: A noiseless patient Spider Lines: 17 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 13 Jun 2014 23:52:52 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="9358cda03e1e0dfd3c4b757daa608707"; logging-data="8836"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+hRve+lj7ulr3zO+ueHhfxrBGqIpMV+Xc=" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: Cancel-Lock: sha1:5rJgqybyAQyfVSKL5ttzWYfqBeM= Xref: csiph.com comp.lang.java.programmer:28725 On 6/13/2014 2:32 PM, Eric Sosman wrote: > For even more "favoritism," you could have the outer class > implement neither Map nor Queue, and delegate both those interfaces > to inner classes. > Or just have two methods to call on some generic object which return a "view" of that object as either a Map or a Queue. interface MyCollection { Map asMap(); Queue asQueue(); }