3.1 - Métodos da classe Tempo.java
@Override
public boolean equals(Object obj) {
if(obj == null){
return false;
}
if (obj == this){
return true;
}
if( ! (obj instanceof Tempo)){
return false;
}
Tempo t = (Tempo) obj;
return this.hora == t.hora &&
this.minuto == t.minuto &&
this.segundo == t.segundo;
}
@Override
public int hashCode() {
int r = 17;
r = 31 * r + this.hora;
r = 31 * r + this.minuto;
r = 31 * r + this.segundo;
return r;
}