From 9cc8a5bc2cccbac53277616f500cee25dbc606a4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Fri, 16 Feb 2018 09:59:58 +0100 Subject: [PATCH] Add Affichable interface. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- Entiers/Entiers.java | 1 + Structure/Entiers.java | 1 + TP2/Affichable.java | 6 ++++++ TP2/Makefile | 2 ++ TP2/Piletransformations.java | 2 +- TP2/Structure.java | 7 +++++++ 6 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 TP2/Affichable.java create mode 100644 TP2/Structure.java diff --git a/Entiers/Entiers.java b/Entiers/Entiers.java index adcc822..4f1168e 100644 --- a/Entiers/Entiers.java +++ b/Entiers/Entiers.java @@ -60,6 +60,7 @@ class Entiers { private int binarySearch(int first, int last, int value) { if (last < first) + //FIXME: should not return an integer return -1; int middle = (first + last) / 2; if (value == int_array[middle]) diff --git a/Structure/Entiers.java b/Structure/Entiers.java index 4abf4f0..b4cffb1 100644 --- a/Structure/Entiers.java +++ b/Structure/Entiers.java @@ -60,6 +60,7 @@ class Entiers extends Structure { private int binarySearch(int first, int last, int value) { if (last < first) + //FIXME: should not return an integer return -1; int middle = (first + last) / 2; if (value == int_array[middle]) diff --git a/TP2/Affichable.java b/TP2/Affichable.java new file mode 100644 index 0000000..2b77230 --- /dev/null +++ b/TP2/Affichable.java @@ -0,0 +1,6 @@ + +public interface Affichable { + + public void afficher(); + +} diff --git a/TP2/Makefile b/TP2/Makefile index 41023ff..ddd7c4c 100644 --- a/TP2/Makefile +++ b/TP2/Makefile @@ -47,6 +47,8 @@ JVM = java CLASSES = \ Point.java \ + Affichable.java \ + Structure.java \ Forme.java \ Image.java \ Segment.java \ diff --git a/TP2/Piletransformations.java b/TP2/Piletransformations.java index 6d25095..5e53ddd 100644 --- a/TP2/Piletransformations.java +++ b/TP2/Piletransformations.java @@ -52,7 +52,7 @@ class Piletransformations { public void display() { System.out.println("----"); - for (int i = 0; i < transformations.length; i++) { + for (int i = 0; i < currentTransformation; i++) { System.out.println(transformations[i].toString()); } } diff --git a/TP2/Structure.java b/TP2/Structure.java new file mode 100644 index 0000000..170928f --- /dev/null +++ b/TP2/Structure.java @@ -0,0 +1,7 @@ + +public abstract class Structure { + + public abstract boolean inserer(int value); + public abstract boolean supprimer(int value); + +} -- 2.34.1