import javax.swing.Timer;

public class Compteur
{
	protected int val=0;
	protected int temps=0;
	int tmax;

	
	public Compteur(int val, int temps, int tmax) {
		super();
		this.val = val;
		this.temps = temps;
		this.tmax=tmax;
	}

	public int getTmax() {
		return tmax;
	}

	public void setTmax(int tmax) {
		this.tmax = tmax;
	}

	public int getTemps() {
		return temps;
	}

	public void setTemps(int temps) {
		this.temps = temps;
	}

	public Compteur(int val)
	{
		this.val = val;
	}

	public Compteur()
	{
		this(0,0,20);
	}

	public Compteur inc()
	{
		val++;
		return this;
	}
	
	public Compteur inct()
	{
		temps++;
		return this;
	}

	public Compteur dec()
	{
		if (val>0) val--;
		return this;
	}
	
	public Compteur zero()
	{
		val = 0;
		return this;
	}
	
	public Compteur setVal(int c)
	{
		val = c;
		return this;
	}

	public int getVal()
	{
		return val;
	}
/*
	public static void main(String[] args)
	{
		Compteur c = new Compteur();
		System.out.println(c.getVal());
		for (int i = 0;i<10;i++) c.inc();
		System.out.println(c.getVal());
		for (int i = 0;i<20;i++) c.dec();
		System.out.println(c.getVal());
	}
*/	
}