From 979297754a1c307ecbd003a745c4586f04f0c81a Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Fri, 16 Feb 2018 11:08:30 +0100 Subject: [PATCH] TP2: Add code skeleton for the Compactable interface. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- TP2/Compactable.java | 6 ++++++ TP2/Entiers.java | 4 ++++ TP2/Image.java | 6 +++++- TP2/Liste.java | 4 ++++ TP2/Makefile | 1 + TP2/Structure.java | 2 +- 6 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 TP2/Compactable.java diff --git a/TP2/Compactable.java b/TP2/Compactable.java new file mode 100644 index 0000000..cd5c39e --- /dev/null +++ b/TP2/Compactable.java @@ -0,0 +1,6 @@ + +public interface Compactable { + + public void compacter(int nElements); + +} diff --git a/TP2/Entiers.java b/TP2/Entiers.java index 80fcc90..a1e18b6 100644 --- a/TP2/Entiers.java +++ b/TP2/Entiers.java @@ -105,4 +105,8 @@ class Entiers extends Structure { } } + public void compacter(int nElements) { + + } + } diff --git a/TP2/Image.java b/TP2/Image.java index b2efe6e..5385626 100644 --- a/TP2/Image.java +++ b/TP2/Image.java @@ -1,5 +1,5 @@ -class Image extends Forme { +class Image extends Forme implements Compactable { final int IMAGE_MAX_SIZE = 100; Forme[] formeCollection; int formeNumber; @@ -52,4 +52,8 @@ class Image extends Forme { } } + public void compacter(int nElements) { + + } + } diff --git a/TP2/Liste.java b/TP2/Liste.java index 2a2aff2..4ead214 100644 --- a/TP2/Liste.java +++ b/TP2/Liste.java @@ -136,4 +136,8 @@ public class Liste extends Structure { } } + public void compacter(int nElements) { + + } + } diff --git a/TP2/Makefile b/TP2/Makefile index 20b4249..d8fc6bd 100644 --- a/TP2/Makefile +++ b/TP2/Makefile @@ -46,6 +46,7 @@ JVM = java # NAME = Camilo Juan CLASSES = \ + Compactable.java \ Affichable.java \ Structure.java \ Point.java \ diff --git a/TP2/Structure.java b/TP2/Structure.java index bfad43a..7c1ce9f 100644 --- a/TP2/Structure.java +++ b/TP2/Structure.java @@ -1,5 +1,5 @@ -public abstract class Structure implements Affichable { +public abstract class Structure implements Affichable, Compactable { public abstract boolean inserer(int value); public abstract boolean supprimer(int value); -- 2.34.1