package org.intermine.template;

/*
 * Copyright (C) 2002-2011 FlyMine
 *
 * This code may be freely distributed and modified under the
 * terms of the GNU Lesser General Public Licence.  This should
 * be distributed with the code.  See the LICENSE file for more
 * information or http://www.gnu.org/copyleft/lesser.html.
 *
 */

import java.util.Comparator;

/**
 * Comparator used for ordering templates by title
 * @author Kim Rutherford
 */
public class TemplateComparator implements Comparator<TemplateQuery>
{
    /**
     * Compare two TemplateQuery objects by title, falling back to name if the titles are
     * identical.
     * {@inheritDoc}
     */
    public int compare(TemplateQuery arg0, TemplateQuery arg1) {

        if (arg0.getTitle().equals(arg1.getTitle())) {
            return arg0.getName().compareTo(arg1.getName());
        } else {
            return arg0.getTitle().compareTo(arg1.getTitle());
        }
    }
}

@@ -692,19 +692,17 @@
 teQuery 
-arg
+t
 0, Templ
@@ -710,19 +710,17 @@
 teQuery 
-arg
+t
 1) %7B%0A%0A  
@@ -729,19 +729,17 @@
     if (
-arg
+t
 0.getTit
@@ -750,19 +750,17 @@
 .equals(
-arg
+t
 1.getTit
@@ -783,27 +783,25 @@
      return 
-arg
+t
 0.getName().
@@ -806,27 +806,25 @@
 ).compareTo(
-arg
+t
 1.getName())
@@ -861,19 +861,17 @@
  return 
-arg
+t
 0.getTit
@@ -889,11 +889,9 @@
 eTo(
-arg
+t
 1.ge

Better names than arg0, arg1