//# 0 errors, 17 messages
//#
package net.sourceforge.pebble.comparator;
    //#reverseblogentryidcomparator.java:1:1: class: net.sourceforge.pebble.comparator.ReverseBlogEntryIdComparator
    //#reverseblogentryidcomparator.java:1:1: method: net.sourceforge.pebble.comparator.ReverseBlogEntryIdComparator.net.sourceforge.pebble.comparator.ReverseBlogEntryIdComparator__static_init

import java.util.Comparator;

/**
 * A comparator used to order blog entry id instances, in reverse order..
 *
 * @author    Simon Brown
 */
public class ReverseBlogEntryIdComparator implements Comparator {
    //#reverseblogentryidcomparator.java:10: method: void net.sourceforge.pebble.comparator.ReverseBlogEntryIdComparator.net.sourceforge.pebble.comparator.ReverseBlogEntryIdComparator()
    //#reverseblogentryidcomparator.java:10: end of method: void net.sourceforge.pebble.comparator.ReverseBlogEntryIdComparator.net.sourceforge.pebble.comparator.ReverseBlogEntryIdComparator()

  /**
   * Compares two objects.
   *
   * @param o1  object 1
   * @param o2  object 2
   * @return  -n, 0 or +n if the date represented by the second blog entry is less than,
   *          the same as or greater than the first, respectively
   */
  public int compare(Object o1, Object o2) {
    String blogEntryId1 = (String)o1;
    //#reverseblogentryidcomparator.java:21: method: int net.sourceforge.pebble.comparator.ReverseBlogEntryIdComparator.compare(Object, Object)
    //#input(int compare(Object, Object)): o1
    //#input(int compare(Object, Object)): o2
    //#output(int compare(Object, Object)): return_value
    //#presumption(int compare(Object, Object)): java.lang.Long:valueOf(...)@24 != null
    //#post(int compare(Object, Object)): init'ed(return_value)
    String blogEntryId2 = (String)o2;
    Long l1 = Long.parseLong(blogEntryId1);
    Long l2 = Long.parseLong(blogEntryId2);

    return l2.compareTo(l1);
    //#reverseblogentryidcomparator.java:26: end of method: int net.sourceforge.pebble.comparator.ReverseBlogEntryIdComparator.compare(Object, Object)
  }

}
    //#output(net.sourceforge.pebble.comparator.ReverseBlogEntryIdComparator__static_init): __Descendant_Table[net/sourceforge/pebble/comparator/ReverseBlogEntryIdComparator]
    //#output(net.sourceforge.pebble.comparator.ReverseBlogEntryIdComparator__static_init): __Dispatch_Table.compare(Ljava/lang/Object;Ljava/lang/Object;)I
    //#post(net.sourceforge.pebble.comparator.ReverseBlogEntryIdComparator__static_init): __Descendant_Table[net/sourceforge/pebble/comparator/ReverseBlogEntryIdComparator] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.comparator.ReverseBlogEntryIdComparator__static_init): __Dispatch_Table.compare(Ljava/lang/Object;Ljava/lang/Object;)I == &compare
    //#reverseblogentryidcomparator.java:: end of method: net.sourceforge.pebble.comparator.ReverseBlogEntryIdComparator.net.sourceforge.pebble.comparator.ReverseBlogEntryIdComparator__static_init
    //#reverseblogentryidcomparator.java:: end of class: net.sourceforge.pebble.comparator.ReverseBlogEntryIdComparator
