/* * MiTiempo.java * * Created on 12 de noviembre de 2001, 01:49 PM */ import java.lang.String; /** * * @author ALvArO ArEnAs */ public class MiTiempo { /** Creates new MiTiempo */ public MiTiempo() { } public MiTiempo(int valor) { tiempo=valor; valorInicial=valor; } public String toString() { int min, seg; String strSeg; min = (int)(tiempo/60); seg = tiempo%60; if(seg<10) strSeg=new String( '0'+Integer.toString(seg) ); else strSeg=new String( Integer.toString(seg) ); return new String( Integer.toString(min)+':'+strSeg ) ; } public void disminuir() { tiempo--; } public int actual() { return tiempo; } public void setInicial() { tiempo = valorInicial; } private int tiempo; private int valorInicial; }