package Model;

import java.io.Serializable;

public class Employe implements Serializable
{
	
	private static final long serialVersionUID = -1445305457638076121L;
	
	private String nom;
	private double production;
	private int heure;
	private String identifiant;
	
	public Employe(String nom,int heure,double production) 
	{
		this.nom = nom;
		this.heure = heure;
		this.production = production;
		id();
	}
	
	public int getHeure() 
	{
		return heure;
	}

	public void setHeure(int heure) 
	{
		this.heure = heure;
	}

	private void id()
	{
		String fin = "";
		fin += (nom.substring(0,2) + Integer.toString((int)(1000*Math.random())));
		this.identifiant = fin;
	}
	
	public String toString()
	{
		return ("Cet employe est : " + this.nom + " a pour une production de : " + this.production + " produit/heure pour un temps de travail de "+ this.heure + " par jour et a pour identifiant: " + this.identifiant);
	}

	public String getNom() 
	{
		return nom;
	}

	public void setNom(String nom) 
	{
		this.nom = nom;
	}

	public double getProduction() 
	{
		return production;
	}

	public void setProduction(double production) 
	{
		this.production = production;
	}

	public String getIdentifiant() 
	{
		return identifiant;
	}

	public void setIdentifiant(String identifiant) 
	{
		this.identifiant = identifiant;
	}

}