From: Jérôme Benoit Date: Fri, 4 May 2018 09:35:15 +0000 (+0200) Subject: Rename an attribute. X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=c3a259eead7f8071c655e7844d2109bf618c26f0;p=TP_POO.git Rename an attribute. Signed-off-by: Jérôme Benoit --- 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; }