1 21 22 package org.opensubsystems.blog.logic; 23 24 import java.util.Comparator ; 25 26 import org.opensubsystems.blog.data.Blog; 27 28 36 public class BlogCaptionComparator implements Comparator  37 { 38 40 44 private static Comparator s_instance = new BlogCaptionComparator(); 45 46 48 53 public static Comparator getInstance( 54 ) 55 { 56 return s_instance; 57 } 58 59 68 public int compare( 69 Object o1, 70 Object o2 71 ) 72 { 73 String strCaption1 = ((Blog)o1).getCaption(); 74 String strCaption2 = ((Blog)o2).getCaption(); 75 76 return strCaption1.compareTo(strCaption2); 77 } 78 } 79 | Popular Tags |