Open GoogleCodeExporter opened 8 years ago
This can be fixed by the following (affected files also attached):
CorparateAddressBook.java [private void displayResult()]:
-426 Arrays.sort(names);
+426 Arrays.sort(names, new CaseInsesitiveCompare()); //Use a comparator
+CaseInsesitiveCompare.java [new file]:
package net.vivekiyer.GAL.wbxml;
import java.util.Comparator;
public class CaseInsesitiveCompare implements Comparator<String> {
@Override
public int compare(String str1, String str2) {
return str1.compareToIgnoreCase(str2);
}
}
If I could also make a suggestion, perhaps use proper case on all names ("Jane
Smith") (as an option?), it is a little difficult to read now that all the case
is jumbled up.
Original comment by brocky1...@gmail.com
on 16 Jun 2011 at 12:42
Attachments:
Correction to the previous message:
the first line of CaseInsesitiveCompare.java should be
package net.vivekiyer.GAL;
not
package net.vivekiyer.GAL.wbxml;
This is correct in the attached file, just a copy/paste error.
Original comment by brocky1...@gmail.com
on 16 Jun 2011 at 3:44
Thanks Rocky
I will pull these changes in into the next release. Will you be interested in
contributing to this project?
Original comment by viveki...@gmail.com
on 20 Jul 2011 at 9:43
It is a project that I am interested in and would like to see with more
features, but having a thesis to write amongst other things I am a bit short
on time.
I can try to help out whenever possible, but that may not be very much.
Original comment by brocky1...@gmail.com
on 22 Jul 2011 at 9:06
Original issue reported on code.google.com by
viveki...@gmail.com
on 4 Jun 2011 at 12:00