|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--animal
Classe abstraite servant de base à tous les animaux
| Field Summary | |
protected int |
age
Age en cours de cet animal |
protected int |
age_maxi
Age que cet animal ne peut pas dépasser |
protected zoo |
monzoo
Zoo auquel appartient l'animal |
protected java.lang.String |
nom
Nom de l'animal |
protected boolean |
vivant
Booléen indiquant si l'animal est vivant |
| Constructor Summary | |
protected |
animal(java.lang.String nom_animal)
Constructeur d'un animal, il faut préciser son nom |
| Method Summary | |
(package private) abstract java.lang.String |
crie()
Fonction devant etre implémentée dans les classes filles, permettant de faire crier un animal |
protected void |
mourir()
Fait mourir cet animal |
protected java.lang.String |
nom()
Donne le nom de cet animal |
protected void |
nourrir()
Nourit un animal |
java.lang.String |
toString()
Retourne une description de cet animal |
protected boolean |
vieillir()
Fait vieillir l'animal d'un an par défaut |
protected boolean |
vieillir(int qte)
Fait vieillir l'animal en incrementant son age avec le paramètre passé à la fonction |
protected boolean |
vivant()
Indique si l'animal vit |
protected void |
voilatonzoo(zoo nouveau_zoo)
Place cet animal dans un zoo |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected boolean vivant
protected int age
protected int age_maxi
protected java.lang.String nom
protected zoo monzoo
| Constructor Detail |
protected animal(java.lang.String nom_animal)
nom_animal - Nom de l'animal| Method Detail |
protected void nourrir()
abstract java.lang.String crie()
public java.lang.String toString()
toString in class java.lang.Objectprotected boolean vieillir(int qte)
qte - Entier représentant le nombre d'années par lequel doit etre incrementé l'age de l'animal
protected boolean vieillir()
protected java.lang.String nom()
protected boolean vivant()
protected void voilatonzoo(zoo nouveau_zoo)
nouveau_zoo - Zoo auquel appartient l'animalprotected void mourir()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||