aspose file tools*
The moose likes Java in General and the fly likes Can 1 same comparator works for Double and String object type's like this ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Reply locked New topic
Author

Can 1 same comparator works for Double and String object type's like this ?

Amandeep Singh
Ranch Hand

Joined: Jul 17, 2008
Posts: 844
this was my original comparator. And it is working.




As my requirements came in, what i did is added a new BOLD code as shown below.

Is it a right thing to do or better i should create a new Comparator ? My old comparator code is for Double value's and my new code added
is for String. Please i don't want to modify the existing code.




this is the new code i added above. it will return from here only when condition comes for my code



SCJP 1.4, SCWCD 5, SCBCD 5, OCPJWSD 5,SCEA-1, Started Assignment Part 2
My blog- http://rkydesigns.blogspot.com
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19720
    
  20

Please Use One Thread Per Question. Continuing here.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can 1 same comparator works for Double and String object type's like this ?