solved Task 1

This commit is contained in:
schrom01 2022-10-04 12:54:21 +02:00
parent 52b3facf00
commit 5e94dc5f40
1 changed files with 8 additions and 2 deletions

View File

@ -49,19 +49,25 @@ public class Competitor implements Comparable<Competitor> {
@Override
public int compareTo(Competitor o) {
// TODO Implement
return 0;
Competitor o2 = (Competitor)o;
return (int) (this.parseTime(time) - o.parseTime(o2.getTime()));
}
@Override
public boolean equals (Object o) {
// TODO Implement
if(o instanceof Competitor){
Competitor o2 = (Competitor)o;
return compareTo(o2) == 0;
}
return false;
}
@Override
public int hashCode() {
// TODO Implement
return 0;
int result = 17;
return result * (int)parseTime(time);
}
}