diff --git a/src/ch/zhaw/ads/Competitor.java b/src/ch/zhaw/ads/Competitor.java index d3af624..9ebe5a7 100644 --- a/src/ch/zhaw/ads/Competitor.java +++ b/src/ch/zhaw/ads/Competitor.java @@ -49,19 +49,25 @@ public class Competitor implements Comparable { @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); } }