/* * [StringArrayCompare.java] * * Summary: compares arrays of Strings, by comparing first String elt. * * Copyright: (c) 2000-2017 Roedy Green, Canadian Mind Products, http://mindprod.com * * Licence: This software may be copied and used freely for any purpose but military. * http://mindprod.com/contact/nonmil.html * * Requires: JDK 1.8+ * * Created with: JetBrains IntelliJ IDEA IDE http://www.jetbrains.com/idea/ * * Version History: * 2.2 2008-04-06 add build to title, tidy code, fix spelling errors. */ package com.mindprod.esper; import java.util.Comparator; /** * compares arrays of Strings, by comparing first String elt. * * @author Roedy Green, Canadian Mind Products * @version 2.2 2008-04-06 add build to title, tidy code, fix spelling errors. * @since 2000 */ final class StringArrayCompare implements Comparator { /** * comparator for array sort * * @param a1 first array to compare * @param a2 second array to compare * * @return a1 - a2 effectively */ public int compare( String[] a1, String[] a2 ) { return a1[ 0 ].compareTo( a2[ 0 ] ); } }