KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > tasklist > usertasks > treetable > StringIgnoreCaseComparator


1 package org.netbeans.modules.tasklist.usertasks.treetable;
2
3 import java.util.Comparator JavaDoc;
4
5 /**
6  * Compares strings
7  */

8 public class StringIgnoreCaseComparator implements Comparator JavaDoc {
9     public int compare(java.lang.Object JavaDoc o1, java.lang.Object JavaDoc o2) {
10         if (o1 == null && o2 == null)
11             return 0;
12         if (o1 == null)
13             return -1;
14         if (o2 == null)
15             return 1;
16         return ((String JavaDoc) o1).compareToIgnoreCase((String JavaDoc) o2);
17     }
18 }
19
Popular Tags