intermediate/ILikeJamComparator

From ggc

Jump to: navigation, search

01 package intermediate;
02 //start auto-imports
03 import java.util.*;
04 //end auto-imports
05 
06 
07 /**
08  * All about my helper class.
09  @author My Name Here
10  */
11 public class ILikeJamComparator
12       extends Object
13       implements Comparator<String>
14 {
15   public int compare(String a, String b)
16   {
17     if(a.toLowerCase().equals("jam"&&
18             b.toLowerCase().equals("jam"))
19       return 0;
20     if(a.toLowerCase().equals("jam"))
21       return -1;
22     if(b.toLowerCase().equals("jam"))
23       return 1;
24     return a.compareTo(b);
25   }
26 }


Download/View intermediate/ILikeJamComparator.java





Views
Personal tools
Add to 
del.icio.usAdd to 
diggAdd to 
FacebookAdd to 
favoritesAdd to 
GoogleAdd to 
MySpaceAdd to 
PrintAdd to 
SlashdotAdd to 
StumbleUponAdd to 
Twitter