repositories
/
Project_POO.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
exo1: rename an attribute.
[Project_POO.git]
/
exo1
/
Pile.java
diff --git
a/exo1/Pile.java
b/exo1/Pile.java
index d69668a952f3cb4434972c200dfe9b257c0d128f..91bd51087ed95e3b7e253f7cc858d77514a66828 100644
(file)
--- a/
exo1/Pile.java
+++ b/
exo1/Pile.java
@@
-6,7
+6,7
@@
import java.lang.reflect.Array;
public class Pile<E> {
private E[] array;
private int array_size;
public class Pile<E> {
private E[] array;
private int array_size;
- private int
stack_
head_index;
+ private int head_index;
/**
* set the size of the internal array
/**
* set the size of the internal array
@@
-29,7
+29,7
@@
public class Pile<E> {
* @param int index the stack head index
*/
public void setHeadIndex(int index) {
* @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<E> {
* @return the integer stack head index
*/
public int getHeadIndex() {
* @return the integer stack head index
*/
public int getHeadIndex() {
- return
stack_
head_index;
+ return head_index;
}
/**
}
/**
@@
-68,8
+68,8
@@
public class Pile<E> {
*/
public void empiler(E value) {
if (!plein()) {
*/
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");
}
} else {
System.out.println("La pile est pleine");
}
@@
-81,8
+81,8
@@
public class Pile<E> {
*/
public E depiler() {
if (!vide()) {
*/
public E depiler() {
if (!vide()) {
-
stack_
head_index--;
- return array[
stack_
head_index];
+ head_index--;
+ return array[head_index];
} else {
return null;
}
} else {
return null;
}