From 480d677324897ee61d6b4948ef6c42798c2d60df Mon Sep 17 00:00:00 2001 From: Valentin Boulanger Date: Sun, 22 Nov 2020 15:52:51 +0100 Subject: [PATCH] =?UTF-8?q?Impl=C3=A9mentation=20de=20la=20classe=20Attrib?= =?UTF-8?q?ute?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AppThinker/src/Attribute.java | 94 +++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 AppThinker/src/Attribute.java diff --git a/AppThinker/src/Attribute.java b/AppThinker/src/Attribute.java new file mode 100644 index 0000000..78e1367 --- /dev/null +++ b/AppThinker/src/Attribute.java @@ -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; + } +}