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 852734b..233456c 100644 --- a/app/src/main/java/ch/nuth/zhaw/exbox/Competitor.java +++ b/app/src/main/java/ch/nuth/zhaw/exbox/Competitor.java @@ -24,6 +24,10 @@ public class Competitor implements Comparable { return time; } + public Long getTimeValue() { + return parseTime(getTime()); + } + public String getName() { return name; } @@ -83,8 +87,13 @@ class AlphaComparatorCompetitor implements Comparator { @Override public int compare(Competitor o1, Competitor o2) { - // TODO Implement - int c = 0; - return c; + int result = o1.getName().compareTo(o2.getName()); + + if (result == 0) { + return Long.compare(o1.getTimeValue(), o2.getTimeValue()); + } + else { + return result; + } } }