Removed 'loko' from Tempo.java. ??
package horaris;
public class Tempo
{
String s;
private int horoj;
private int minutoj;
public Tempo(String tempo)
{
fromStr(tempo);
}
private void fromStr(String _s)
{
s = _s;
int colon = s.indexOf(':');
horoj = Integer.parseInt(s.substring(0,colon));
minutoj = Integer.parseInt(s.substring(colon+1));
}
/* 1: this later than t2
* 0: this equal to t2
* -1: this earlier than t2 */
public int compareTo(Tempo t2)
{
if (horoj > t2.horoj)
return 1;
else if (horoj == t2.horoj && minutoj > t2.minutoj)
return 1;
else if (horoj == t2.horoj && minutoj == t2.minutoj)
return 0;
else
return -1;
}
public String toString()
{
return s;
}
}