Re: Proposal: Comparables.isCommutativelyComparable

2013-06-10 Thread Aleksey Shipilev
Hm, sounds interesting. What's about yet another "factory"-like default in Comparator: Comparator Comparator.make(Class klass) - returns synthetic comparator using C.compareTo iff C implements Comparable - returns null otherwise That will naively instantiate the Comparator, but there is the

Re: Proposal: Comparables.isCommutativelyComparable

2013-06-10 Thread Doug Lea
On 06/08/13 21:52, Martin Buchholz wrote: On Sat, Jun 8, 2013 at 8:50 AM, Doug Lea mailto:d...@cs.oswego.edu>> wrote: Suppose you have two objects, x and y, both of the same type (x.getClass() == y.getClass()) and both known to be instanceof Comparable. Can you compare them? Th

Re: Proposal: Comparables.isCommutativelyComparable

2013-06-10 Thread Aleksey Shipilev
On 08.06.2013, at 23:51, Aleksey Shipilev wrote: > Hm, sounds interesting. > > What's about yet another "factory"-like default in Comparator: > > Comparator Comparator.make(Class klass) > - returns synthetic comparator using C.compareTo iff C implements > Comparable > - returns null otherwis