1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
package tim.prune.function.comparesegments;
import tim.prune.gui.DisplayUtils;
/**
* Defines a duration in the table, so that the presentation
* is independent of the sort order
*/
class Duration implements Comparable<Duration>
{
private final long _seconds;
private final String _displayValue;
public Duration(long inSeconds)
{
_seconds = inSeconds;
_displayValue = DisplayUtils.buildDurationString(inSeconds);
}
public String toString() {
return _displayValue;
}
public int compareTo(Duration inOther) {
return Long.compare(_seconds, inOther._seconds);
}
}
|