/**
* Exemple de classe a 2 attributs
*
* @author Denis BUREAU
* @version 2015.01.15
*/
public class NomClasse
{
private TypeAttribut1 aNomAttribut1;
private TypeAttribut2 aNomAttribut2;
/**
* Constructeur par defaut
*/
public NomClasse()
{
this.aNomAttribut1 = valeurFixe1;
this.aNomAttribut2 = valeurFixe2;
// ces 2 affectations sont remplacables par un seul appel au constructeur naturel s'il existe
} // NomClasse()
/**
* Constructeur naturel
* @param pNomAttribut1 valeur a mettre dans aNomAttribut1
* @param pNomAttribut2 valeur a mettre dans aNomAttribut2
*/
public NomClasse( final TypeAttribut1 pNomAttribut1, final TypeAttribut2 pNomAttribut2 )
{
this.aNomAttribut1 = pNomAttribut1;
this.aNomAttribut2 = pNomAttribut2;
} // NomClasse(..)
/**
* Constructeur quelconque (qui appelle le constructeur naturel)
* @param pNomAttribut2 valeur a mettre dans aNomAttribut2
*/
public NomClasse( final TypeAttribut2 pNomAttribut2 )
{
this( valeurFixe1, pNomAttribut2 ); // si le constructeur naturel existe
} // NomClasse(.)
/**
* Accesseur du premier attribut
* @return la valeur de aNomAttribut1
*/
public TypeAttribut1 getNomAttribut1()
{
return this.aNomAttribut1;
} // getNomAttribut1()
/**
* Fonction quelconque (avec eventuellement des parametres)
* @return une valeur de type TypeValeurRetournee
*/
public TypeValeurRetournee NomFonction( /*liste de parametres*/ )
{
// instructions
return valeurRetournee;
} // NomFonction( )
/**
* Modificateur du premier attribut
* @param pNomAttribut1 valeur a mettre dans aNomAttribut1
*/
public void setNomAttribut1( final TypeAttribut1 pNomAttribut1 )
{
this.aNomAttribut1 = pNomAttribut1;
} // setNomAttribut1(.)
/**
* Procedure quelconque (avec eventuellement des parametres)
*/
public void NomProcedure( /*liste de parametres*/ )
{
// instructions
} // NomProcedure( )
} // NomClasse