Implémentation de la classe Attribute

This commit is contained in:
2020-11-22 15:52:51 +01:00
parent 366a2865aa
commit 480d677324

View File

@@ -0,0 +1,94 @@
/**
* Gère un attribut.
* @author V.BOULANGER
*/
public class Attribute {
public static int _attributesId = 0;
private int _id;
private String _access;
private String _type;
private String _name;
/**
* Constructeur - Crée une instance de Attribute.
*/
public Attribute(){
_attributesId++;
this._id = _attributesId;
this._access = "private";
this._type = null;
this._name = "attribut" + this._id;
}
/**
* Constructeur - Crée une instance de Attribute avec des paramètres donnés.
* @param access Le modificateur d'accès de l'attribut.
* @param name Le nom de l'attribut.
* @param type Le type de l'attribut.
*/
public Attribute(String name, String access, String type){
_attributesId++;
this._id = _attributesId;
this._access = access;
this._type = type;
this._name = name;
}
/**
* Récupère le numéro de l'attribut.
* @return Le numéro de l'attribut.
*/
public int getId() {
return _id;
}
/**
* Récupère le modificateur d'accès de l'attribut.
* @return Le modificateur d'accès de l'attribut
*/
public String getAccess() {
return _access;
}
/**
* Paramètre le modificateur d'accès de l'attribut.
* @param access Le modificateur d'accès de l'attribut
*/
public void setAccess(String access) {
this._access = access;
}
/**
* Récupère le type de l'attribut.
* @return Le type de l'attribut.
*/
public String getType() {
return _type;
}
/**
* Paramètre le type de l'attribut.
* @param type Le type de l'attribut.
*/
public void setType(String type) {
this._type = type;
}
/**
* Récupère le nom de l'attribut.
* @return Le nom de l'attribut.
*/
public String getName() {
return _name;
}
/**
* Paramètre le nom de l'attribut.
* @param name Le nom de l'attribut.
*/
public void setName(String name) {
this._name = name;
}
}