File Source: reverseblogentryidcomparator.java

         /* 
    P/P   *  Method: net.sourceforge.pebble.comparator.ReverseBlogEntryIdComparator__static_init
          */
     1  package net.sourceforge.pebble.comparator;
     2  
     3  import java.util.Comparator;
     4  
     5  /**
     6   * A comparator used to order blog entry id instances, in reverse order..
     7   *
     8   * @author    Simon Brown
     9   */
         /* 
    P/P   *  Method: void net.sourceforge.pebble.comparator.ReverseBlogEntryIdComparator()
          */
    10  public class ReverseBlogEntryIdComparator implements Comparator {
    11  
    12    /**
    13     * Compares two objects.
    14     *
    15     * @param o1  object 1
    16     * @param o2  object 2
    17     * @return  -n, 0 or +n if the date represented by the second blog entry is less than,
    18     *          the same as or greater than the first, respectively
    19     */
    20    public int compare(Object o1, Object o2) {
             /* 
    P/P       *  Method: int compare(Object, Object)
              * 
              *  Presumptions:
              *    java.lang.Long:valueOf(...)@24 != null
              * 
              *  Postconditions:
              *    init'ed(return_value)
              */
    21      String blogEntryId1 = (String)o1;
    22      String blogEntryId2 = (String)o2;
    23      Long l1 = Long.parseLong(blogEntryId1);
    24      Long l2 = Long.parseLong(blogEntryId2);
    25  
    26      return l2.compareTo(l1);
    27    }
    28  
    29  }








SofCheck Inspector Build Version : 2.22510
reverseblogentryidcomparator.java 2010-Jun-25 19:40:32
reverseblogentryidcomparator.class 2010-Jul-19 20:23:40