Back to project page MentalMathX.
The source code is released under:
GNU General Public License
If you think the Android project MentalMathX listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package net.schlingel.bplaced.mentalmathx.utils; // ww w . ja v a 2s . c om import net.schlingel.bplaced.mentalmathx.model.Score; import java.util.Comparator; /** * Created by zombie on 08.09.14. */ public class RegularScoreComparator implements Comparator<Score> { @Override public int compare(Score score, Score score2) { if(score.getTimeInSec() < score2.getTimeInSec()) { return -1; } else if(score.getTimeInSec() > score2.getTimeInSec()) { return 1; } else if(score.getWrongGuesses() < score2.getWrongGuesses()) { return -1; } else if(score.getWrongGuesses() > score2.getWrongGuesses()) { return 1; } return 0; } }