Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. import java.util.Comparator;
  2.  
  3.  
  4. public class DateCompare implements Comparator<Personagem>{
  5. public int compare (Personagem one, Personagem two){
  6. if (one.getYear() != two.getYear()){
  7. return one.getYear() - two.getYear();
  8. }
  9. if (one.getMonth() != two.getMonth()){
  10. return one.getMonth() - two.getMonth();
  11. }
  12. if (one.getDay() != two.getDay()){
  13. return one.getDay()-two.getDay();
  14. }
  15. else{
  16. return 0 ;
  17. }
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement