DateComparator.java [src/java/datadownload] Revision: default Date:
package datadownload;
import java.util.Comparator;
/**
* Last Updated: 4-February-2016
* @author Tyler Wible
* @since 4-February-2016
*/
public class DateComparator implements Comparator<String[]>{
//Compares the first entry of sorted data as flow values and sorts largest to smallest
public int compare(final String[] entry1, final String[] entry2) {
String value1 = entry1[0];
String value2 = entry2[0];
int comparison = value1.compareTo(value2);
if(comparison>0){
return 1;
}else if(comparison<0){
return -1;
}else{
return 0;
}
}
}