Hi David, It doesn't work really in the general case because of wrapper classes
Collections.unmodifyableCollection(c) for instance need to infer the characteristics from the content It could be a default implementation though Regards Mike ------Original Message------ From: David Schlosnagle To: Rémi Forax Cc: Mike Skells Cc: [email protected] Subject: Re: Any chance to see EnumSet implement SortedSet in JDK8? Sent: 12 Aug 2011 17:24 On Fri, Aug 12, 2011 at 9:06 AM, Rémi Forax <[email protected]> wrote: > On 08/12/2011 02:46 PM, [email protected] wrote: >> >> Hi Remi, >> Your argument is flawed >> >> The complexity of the operations is not defined by the interface or the >> presence or absence of the interface > > In theory yes, but in practice ... > What is the purpose of java.util.RandomAccess ? > >> If you have complexity algo checks then these can only be applied to known >> classes where the complexity is defined in the interface or class >> >> As such the code that infers this behaviour is broken and needs to be >> fixed. > > Ok, how to remove the instanceof RandomAccess in Collections.shuffle (by > example). Does anyone know if there has ever been a proposal or experiments to use annotations to provide algorithmic complexity information for a given method implementation? This might be an interesting experiment rather than adding marker interfaces that apply to an entire class. - Dave Sent from my BlackBerry® wireless device
