From: Jérôme Benoit Date: Tue, 17 Apr 2018 20:21:00 +0000 (+0200) Subject: exo1: rename an attribute. X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=f1809579c7e4fe66338985cc6f8e9e5c2399cf0e;p=Project_POO.git exo1: rename an attribute. Signed-off-by: Jérôme Benoit --- diff --git a/exo1/Pile.java b/exo1/Pile.java index d69668a..91bd510 100644 --- a/exo1/Pile.java +++ b/exo1/Pile.java @@ -6,7 +6,7 @@ import java.lang.reflect.Array; public class Pile { private E[] array; private int array_size; - private int stack_head_index; + private int head_index; /** * set the size of the internal array @@ -29,7 +29,7 @@ public class Pile { * @param int index the stack head index */ public void setHeadIndex(int index) { - stack_head_index = index; + head_index = index; } /** @@ -37,7 +37,7 @@ public class Pile { * @return the integer stack head index */ public int getHeadIndex() { - return stack_head_index; + return head_index; } /** @@ -68,8 +68,8 @@ public class Pile { */ public void empiler(E value) { if (!plein()) { - array[stack_head_index] = value; - stack_head_index++; + array[head_index] = value; + head_index++; } else { System.out.println("La pile est pleine"); } @@ -81,8 +81,8 @@ public class Pile { */ public E depiler() { if (!vide()) { - stack_head_index--; - return array[stack_head_index]; + head_index--; + return array[head_index]; } else { return null; }