X-Git-Url: https://git.piment-noir.org/?p=TP_POO.git;a=blobdiff_plain;f=Piles%2FPile.java;h=e2cc0c470486d69833d790c5e157b867f128fed9;hp=915a63c168bcf248dc2023424c34064f7042031d;hb=306320428497edce10fbd9e0b36204c8764b7273;hpb=27869e5bfad44707f302ca8dd7642829c45346ec diff --git a/Piles/Pile.java b/Piles/Pile.java index 915a63c..e2cc0c4 100644 --- a/Piles/Pile.java +++ b/Piles/Pile.java @@ -2,38 +2,38 @@ /** * */ -class Pile { +public class Pile { private int int_array[]; private int array_size; private int stack_head_index; /** - * [setSize description] - * @param int size [description] + * set the size of the internal array + * @param int size the size of the array */ private void setSize(int size) { array_size = size; } /** - * [getSize description] - * @return [description] + * get the size of the internal array + * @return the integer size of the internal array */ private int getSize() { return array_size; } /** - * [setHeadIndex description] - * @param int index [description] + * set the stack head index + * @param int index the stack head index */ private void setHeadIndex(int index) { stack_head_index = index; } /** - * [getHeadIndex description] - * @return [description] + * get the stack head current index + * @return the integer stack head index */ private int getHeadIndex() { return stack_head_index; @@ -95,7 +95,7 @@ class Pile { * [afficher description] */ public void afficher() { - for (int i = 0; i < getSize(); i++) { + for (int i = 0; i < getHeadIndex(); i++) { System.out.println("element " + i + " " + int_array[i]); } }