Java binary search already sorted list

I've a DB query using ORDERED BY and the corresponding result set is processed to a list of custom objects.

The object class does not implement Comparable . It however overrides equals() and hashcode() using the same field as used in ORDERED BY .

Since the list is already sorted , how can I do a binary search of the list using the sorted field as key and without comparable or comparator?

Answer:1

I have created a JButton class that recieving Action, the JButton class includes keystrokes & mouse listener so i can use the same class in multiple frames as needed. My problems is that: JButton ...

I wish to pass to Hibernate's SessionFactory hibernate.hbm2ddl.auto=update and see in log file generated sql statements. Is it possible w/o java coding (know how to achieve the result with ...

This post shows that the code below creates a List from an array. double[] features = new double[19]; List<Double> list = new ArrayList(Arrays.asList(features)); I'm expecting list to contain ...

What is the difference between the two following methods of array initialization: Object[] oArr = new Object[] {new Object(), new Object()}; Object[] oArr = {new Object(), new Object()}; Is it ...