Results 1 to 5 of 5
- 03-21-2010, 01:59 PM #1
Member
- Join Date
- Mar 2010
- Posts
- 4
- Rep Power
- 0
SortedSet and Collections.binarySearch
hello everyone...
I created my type which implements Comparable like
public class Key implements Comparable{
...
}
and i added couple of keys in my sorted set
SortedSet<Key> keys = new TreeSet<Key>();
keys.add(new Key(...));
keys.add(new Key(...));
keys.add(new Key(...));
when i try to binarysearch my sorted set like Collections.binarySearch(keys, new Key());
i have error message:
The method binarySearch(List<? extends Comparable<? super T>>, T) in the type Collections is not applicable for the arguments (SortedSet<Key>, Key)
Can anyone explicitly write how to invoke binarySearch for theese types without error message...
Thanks
- 03-21-2010, 05:38 PM #2
- 03-22-2010, 08:57 AM #3
Member
- Join Date
- Mar 2010
- Posts
- 4
- Rep Power
- 0
I want to find answer as soon as possible.
It does not mean anything bad...
Sorry
- 03-22-2010, 10:53 AM #4
Member
- Join Date
- Mar 2010
- Posts
- 4
- Rep Power
- 0
Ok, people...
Sorry for my cross thread...
I do not want to hurt anybody but can someone shut discussion for this thread?
- 03-22-2010, 03:28 PM #5
Member
- Join Date
- Mar 2010
- Posts
- 4
- Rep Power
- 0
Similar Threads
-
Collections
By Cbani in forum New To JavaReplies: 3Last Post: 02-16-2010, 02:46 PM -
how does public static <AnyType extends Comparable<? super AnyType>> int binarySearch
By JordashTalon in forum New To JavaReplies: 4Last Post: 02-13-2009, 07:42 AM -
Collections Help
By Dr Gonzo in forum New To JavaReplies: 0Last Post: 12-07-2008, 09:15 PM -
Use different comparator for SortedSet
By linus_k in forum New To JavaReplies: 0Last Post: 11-21-2008, 02:46 PM -
Performance Of Collections
By thomasprabu in forum Advanced JavaReplies: 0Last Post: 01-05-2008, 11:17 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks