reverseresponseidcomparator.java

### File Source: reverseresponseidcomparator.java

             /*
        P/P   *  Method: net.sourceforge.pebble.comparator.ReverseResponseIdComparator__static_init
              */
         1  package net.sourceforge.pebble.comparator;
         2
         3  import java.util.Comparator;
         4
         5  /**
         6   * A comparator used to order response ids, in reverse order.
         7   *
         8   * @author    Simon Brown
         9   */
             /*
        P/P   *  Method: void net.sourceforge.pebble.comparator.ReverseResponseIdComparator()
              */
        10  public class ReverseResponseIdComparator 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)
                  *
                  *  Preconditions:
                  *    o1 != null
                  *    o2 != null
                  *
                  *  Postconditions:
                  *    init'ed(return_value)
                  */
        21      String responseId1 = (String)o1;
        22      String responseId2 = (String)o2;
        23
        24      int start = responseId1.lastIndexOf("/");
        25      return responseId2.substring(start).compareTo(responseId1.substring(start));
        26    }
        27
        28  }

SofCheck Inspector Build Version : 2.22510

reverseresponseidcomparator.java | 2010-Jun-25 19:40:32
reverseresponseidcomparator.class | 2010-Jul-19 20:23:40