Add Affichable interface.
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Fri, 16 Feb 2018 08:59:58 +0000 (09:59 +0100)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Fri, 16 Feb 2018 08:59:58 +0000 (09:59 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
Entiers/Entiers.java
Structure/Entiers.java
TP2/Affichable.java [new file with mode: 0644]
TP2/Makefile
TP2/Piletransformations.java
TP2/Structure.java [new file with mode: 0644]

index adcc8221fc812bc2d1b181a92a9edaa21652434c..4f1168ecad39fa68f87e52aee552e576ad7b4b43 100644 (file)
@@ -60,6 +60,7 @@ class Entiers {
 
     private int binarySearch(int first, int last, int value) {
         if (last < first)
 
     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])
             return -1;
         int middle = (first + last) / 2;
         if (value == int_array[middle])
index 4abf4f0ba8be2bda10cd4ff51851ab561ba0a6c0..b4cffb15f6f90406be47212e9f9dede7a02f1e66 100644 (file)
@@ -60,6 +60,7 @@ class Entiers extends Structure {
 
     private int binarySearch(int first, int last, int value) {
         if (last < first)
 
     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])
             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 (file)
index 0000000..2b77230
--- /dev/null
@@ -0,0 +1,6 @@
+
+public interface Affichable {
+
+    public void afficher();
+
+}
index 41023ffc3a6f7e2c0d63ca70336eac643cd45f49..ddd7c4c5a5e1304f8f44fc4a339c181ebbd344cd 100644 (file)
@@ -47,6 +47,8 @@ JVM = java
 
 CLASSES = \
         Point.java \
 
 CLASSES = \
         Point.java \
+               Affichable.java \
+               Structure.java \
                Forme.java \
                Image.java \
                Segment.java \
                Forme.java \
                Image.java \
                Segment.java \
index 6d25095deba9637895880629417389fdcaeedad7..5e53ddd7e3500a9fe421ab290b388a4478658075 100644 (file)
@@ -52,7 +52,7 @@ class Piletransformations {
 
     public void display() {
         System.out.println("----");
 
     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());
         }
     }
             System.out.println(transformations[i].toString());
         }
     }
diff --git a/TP2/Structure.java b/TP2/Structure.java
new file mode 100644 (file)
index 0000000..170928f
--- /dev/null
@@ -0,0 +1,7 @@
+
+public abstract class Structure {
+
+    public abstract boolean inserer(int value);
+    public abstract boolean supprimer(int value);
+
+}