From c3a259eead7f8071c655e7844d2109bf618c26f0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Fri, 4 May 2018 11:35:15 +0200 Subject: [PATCH] Rename an attribute. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- Piles/Pile.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Piles/Pile.java b/Piles/Pile.java index e2cc0c4..07c5a77 100644 --- a/Piles/Pile.java +++ b/Piles/Pile.java @@ -5,7 +5,7 @@ public class Pile { private int int_array[]; private int array_size; - private int stack_head_index; + private int head_index; /** * set the size of the internal array @@ -28,7 +28,7 @@ public class Pile { * @param int index the stack head index */ private void setHeadIndex(int index) { - stack_head_index = index; + head_index = index; } /** @@ -36,7 +36,7 @@ public class Pile { * @return the integer stack head index */ private int getHeadIndex() { - return stack_head_index; + return head_index; } /** @@ -55,8 +55,8 @@ public class Pile { */ public void empiler(int value) { if (!plein()) { - int_array[stack_head_index] = value; - stack_head_index++; + int_array[head_index] = value; + head_index++; } else { System.out.println("La pile est pleine"); } @@ -68,8 +68,8 @@ public class Pile { */ public int depiler() { if (!vide()) { - stack_head_index--; - return int_array[stack_head_index]; + head_index--; + return int_array[head_index]; } else { return -1; } -- 2.34.1