diff --git a/app/src/main/java/ch/nuth/zhaw/exbox/Competitor.java b/app/src/main/java/ch/nuth/zhaw/exbox/Competitor.java index 03b4d3a..84b79f7 100644 --- a/app/src/main/java/ch/nuth/zhaw/exbox/Competitor.java +++ b/app/src/main/java/ch/nuth/zhaw/exbox/Competitor.java @@ -48,20 +48,23 @@ public class Competitor implements Comparable { @Override public int compareTo(Competitor o) { - // TODO Implement - return 0; + return Long.compare(parseTime(getTime()), parseTime(o.getTime())); } @Override public boolean equals (Object o) { - // TODO Implement - return false; + if (o instanceof Competitor) { + Competitor c = (Competitor)o; + return compareTo(c) == 0; + } + else { + return false; + } } @Override public int hashCode() { - // TODO Implement - return 0; + return (getTime().hashCode() + getName().hashCode()) * rank; } }