Make javadoc work.
[TP_POO.git] / Piles / Pile.java
index b82dd7e8f99ff3007d36af587b2ea9a76c3b4033..565432498d47f40d52ead6fe175e57bb81fcb85a 100644 (file)
@@ -1,31 +1,58 @@
 
-class Pile {
+/**
+ *
+ */
+public class Pile {
     private int int_array[];
     private int array_size;
     private int stack_head_index;
 
+    /**
+     * [setSize description]
+     * @param int size [description]
+     */
     private void setSize(int size) {
         array_size = size;
     }
 
+    /**
+     * [getSize description]
+     * @return [description]
+     */
     private int getSize() {
         return array_size;
     }
 
+    /**
+     * [setHeadIndex description]
+     * @param int index [description]
+     */
     private void setHeadIndex(int index) {
         stack_head_index = index;
     }
 
+    /**
+     * [getHeadIndex description]
+     * @return [description]
+     */
     private int getHeadIndex() {
         return stack_head_index;
     }
 
+    /**
+     * [Pile description]
+     * @param int size [description]
+     */
     Pile(int size) {
         int_array = new int[size];
         setSize(size);
         setHeadIndex(0);
     }
 
+    /**
+     * [empiler description]
+     * @param int value [description]
+     */
     public void empiler(int value) {
         if (!plein()) {
             int_array[stack_head_index] = value;
@@ -35,6 +62,10 @@ class Pile {
         }
     }
 
+    /**
+     * [depiler description]
+     * @return [description]
+     */
     public int depiler() {
         if (!vide()) {
             stack_head_index--;
@@ -44,20 +75,35 @@ class Pile {
         }
     }
 
-    public boolean plein() {
+    /**
+     * [plein description]
+     * @return [description]
+     */
+    private boolean plein() {
         return (getHeadIndex() >= getSize());
     }
 
-    public boolean vide() {
+    /**
+     * [vide description]
+     * @return [description]
+     */
+    private boolean vide() {
         return (getHeadIndex() == 0);
     }
 
+    /**
+     * [afficher description]
+     */
     public void afficher() {
         for (int i = 0; i < getSize(); i++) {
             System.out.println("element " + i + " " + int_array[i]);
         }
     }
 
+    /**
+     * The main() function
+     * @param String[] args main() function arguments array
+     */
     public static void main(String[] args) {
         Pile stack = new Pile(5);
 
@@ -69,19 +115,19 @@ class Pile {
 
         stack.afficher();
 
-        System.out.println("stack index " + stack.getHeadIndex());
-        System.out.println("stack head value " + stack.depiler());
-        System.out.println("stack index " + stack.getHeadIndex());
-        System.out.println("stack head value " + stack.depiler());
-        System.out.println("stack index " + stack.getHeadIndex());
-        System.out.println("stack head value " + stack.depiler());
-        System.out.println("stack index " + stack.getHeadIndex());
-        System.out.println("stack head value " + stack.depiler());
-        System.out.println("stack index " + stack.getHeadIndex());
-        System.out.println("stack head value " + stack.depiler());
-        System.out.println("stack index " + stack.getHeadIndex());
-        System.out.println("stack head value " + stack.depiler());
-        System.out.println("stack index " + stack.getHeadIndex());
+        System.out.println("Stack index " + stack.getHeadIndex());
+        System.out.println("Stack head value " + stack.depiler());
+        System.out.println("Stack index " + stack.getHeadIndex());
+        System.out.println("Stack head value " + stack.depiler());
+        System.out.println("Stack index " + stack.getHeadIndex());
+        System.out.println("Stack head value " + stack.depiler());
+        System.out.println("Stack index " + stack.getHeadIndex());
+        System.out.println("Stack head value " + stack.depiler());
+        System.out.println("Stack index " + stack.getHeadIndex());
+        System.out.println("Stack head value " + stack.depiler());
+        System.out.println("Stack index " + stack.getHeadIndex());
+        System.out.println("Stack head value " + stack.depiler());
+        System.out.println("Stack index " + stack.getHeadIndex());
 
         stack.afficher();
     }