From f1809579c7e4fe66338985cc6f8e9e5c2399cf0e Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Tue, 17 Apr 2018 22:21:00 +0200 Subject: [PATCH] exo1: rename an attribute. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- exo1/Pile.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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; } -- 2.34.1