diff --git a/bin/tp4/UsePendingCaseQueue.class b/bin/tp4/UsePendingCaseQueue.class index f580ea00246d8c124f0473c4cb45744b36a97c39..98deb9f0a171493125efa2eff9c95ff0dd60630d 100644 Binary files a/bin/tp4/UsePendingCaseQueue.class and b/bin/tp4/UsePendingCaseQueue.class differ diff --git a/bin/tp5/Book.class b/bin/tp5/Book.class new file mode 100644 index 0000000000000000000000000000000000000000..97170951341a7123a623393b046dda33f2d833de Binary files /dev/null and b/bin/tp5/Book.class differ diff --git a/bin/tp5/Library.class b/bin/tp5/Library.class new file mode 100644 index 0000000000000000000000000000000000000000..654aa739b60d2312e88a05b27121779862feaa65 Binary files /dev/null and b/bin/tp5/Library.class differ diff --git a/bin/tp6/Company.class b/bin/tp6/Company.class new file mode 100644 index 0000000000000000000000000000000000000000..881098ac0ab8d38c2ecc16efddd9b59a81eb81c9 Binary files /dev/null and b/bin/tp6/Company.class differ diff --git a/bin/tp7/BidirectionalPhoneBookTest.class b/bin/tp7/BidirectionalPhoneBookTest.class new file mode 100644 index 0000000000000000000000000000000000000000..7089ca08637748301fe07343f477189ca89363d3 Binary files /dev/null and b/bin/tp7/BidirectionalPhoneBookTest.class differ diff --git a/bin/tp7/BreedingFarmTest.class b/bin/tp7/BreedingFarmTest.class new file mode 100644 index 0000000000000000000000000000000000000000..3a472eb0a8ce781bcb8e5d5ace7756c4dec23710 Binary files /dev/null and b/bin/tp7/BreedingFarmTest.class differ diff --git a/bin/tp7/DuckTest.class b/bin/tp7/DuckTest.class new file mode 100644 index 0000000000000000000000000000000000000000..7294f07ca4d4667acfd80995b213ea6062ddf0d9 Binary files /dev/null and b/bin/tp7/DuckTest.class differ diff --git a/bin/tp7/GooseTest.class b/bin/tp7/GooseTest.class new file mode 100644 index 0000000000000000000000000000000000000000..2de394382b2b495af154fec716f1610f384cbdda Binary files /dev/null and b/bin/tp7/GooseTest.class differ diff --git a/bin/tp7/HenTest.class b/bin/tp7/HenTest.class new file mode 100644 index 0000000000000000000000000000000000000000..eb21766894971d8ca48cbddd7fbed76bee7dc93f Binary files /dev/null and b/bin/tp7/HenTest.class differ diff --git a/bin/tp7/ProPhoneNumber.class b/bin/tp7/ProPhoneNumber.class new file mode 100644 index 0000000000000000000000000000000000000000..88c87718c07231784dce66ff833420b3b48cc0ee Binary files /dev/null and b/bin/tp7/ProPhoneNumber.class differ diff --git a/bin/tp7/ProPhoneNumberTest.class b/bin/tp7/ProPhoneNumberTest.class new file mode 100644 index 0000000000000000000000000000000000000000..fb490cd2db2eed3e682bcb16f7a2306c1b6eac33 Binary files /dev/null and b/bin/tp7/ProPhoneNumberTest.class differ diff --git a/bin/tp7/UniversityDepartment.class b/bin/tp7/UniversityDepartment.class new file mode 100644 index 0000000000000000000000000000000000000000..b87eadeba694e6d0191587f3561a405a974e7b14 Binary files /dev/null and b/bin/tp7/UniversityDepartment.class differ diff --git a/bin/tp8/Comparable b/bin/tp8/Comparable new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/bin/tp8/Food.class b/bin/tp8/Food.class new file mode 100644 index 0000000000000000000000000000000000000000..8ffdf35ddbe12421f10d500b90091489d49e9aaa Binary files /dev/null and b/bin/tp8/Food.class differ diff --git a/bin/tp8/IProduct.class b/bin/tp8/IProduct.class new file mode 100644 index 0000000000000000000000000000000000000000..9c0aa4ed671c514e893fa2d9a7e6524a97b87fe4 Binary files /dev/null and b/bin/tp8/IProduct.class differ diff --git a/bin/tpqu02/WarriorCard.class b/bin/tpqu02/WarriorCard.class index a66ba1db34f05fc980c43c9507c76cbc0afee481..c212cfb14f6b32e60dff5d8ec03152bf9678289d 100644 Binary files a/bin/tpqu02/WarriorCard.class and b/bin/tpqu02/WarriorCard.class differ diff --git a/src/tp8/Food.java b/src/tp8/Food.java new file mode 100644 index 0000000000000000000000000000000000000000..6ee7d33d68d24b0f803b82e9d96c13b94e5c2603 --- /dev/null +++ b/src/tp8/Food.java @@ -0,0 +1,50 @@ +package tp8; +import java.time.LocalDate; + +public class Food implements IProduct, Comparable<Food> { + // Attributs + private String label; + private double price; + private LocalDate isBestBefore; + private static int XXX = 0; + + // Constructeurs + public Food(String label, double price, LocalDate isBestBefore) { + this.label = label; + this.price = price; + this.isBestBefore = isBestBefore; + } + + public Food(String label, double price) { + this(label, price, LocalDate.now().plusDays(10)); + } + + public Food(double price, LocalDate isBestBefore) { + this.label = "refUnknown" + Food.XXX; + Food.XXX++; + this.price = price; + this.isBestBefore = isBestBefore; + } + + + // Méthodes + public boolean isPerishable() { + return true; + } + + @Override + public String toString() { + return "[" + this.label + "=" + this.price + " -> before" + this.isBestBefore + "]"; + } + + boolean isBestBefore() { + return LocalDate.now().isAfter(this.isBestBefore); + } + + @Override + public int compareTo(Food other) { + return this.isBestBefore.compareTo(other.isBestBefore); + } + + +} diff --git a/src/tp8/Furniture.java b/src/tp8/Furniture.java new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/tp8/IProduct.java b/src/tp8/IProduct.java new file mode 100644 index 0000000000000000000000000000000000000000..e7aa1080d4a703daf7f3f223aebb1677188cfc3d --- /dev/null +++ b/src/tp8/IProduct.java @@ -0,0 +1,8 @@ +package tp8; +public interface IProduct { + public double getPrice(); + + + public boolean isPerishable(); + +} \ No newline at end of file