diff --git a/src/noteBook/NoteBook.java b/src/noteBook/NoteBook.java index d5e7d4b..912834c 100644 --- a/src/noteBook/NoteBook.java +++ b/src/noteBook/NoteBook.java @@ -1,9 +1,7 @@ package noteBook; -import input.Gender; -import input.Input; -import input.Person; -import input.Society; +import input.*; + import java.io.File; import java.io.IOException; import java.util.Scanner; @@ -45,7 +43,6 @@ public class NoteBook { } } } -} public void addInput(Input in) { Input[] tmp = new Input[inputs.length+1]; @@ -81,4 +78,22 @@ public class NoteBook { System.arraycopy(tmp, 0, out, 0, out.length); return out; } + + public void display(input.Order inputOrder, Presentation presentation, noteBook.Order noteBookOrder) { + if (noteBookOrder == noteBook.Order.CROISSANT) + for (Input i: inputs) + System.out.println(i.toString(presentation, inputOrder)); + else + for (int i = inputs.length-1; i>=0; i--) + System.out.println(inputs[i].toString(presentation, inputOrder)); + } + + public void displaySelected(input.Order inputOrder, Presentation presentation, noteBook.Order noteBookOrder) { + if (noteBookOrder == noteBook.Order.CROISSANT) + for (Input i: selected) + System.out.println(i.toString(presentation, inputOrder)); + else + for (int i = selected.length-1; i>=0; i--) + System.out.println(inputs[i].toString(presentation, inputOrder)); + } } diff --git a/src/test/TestAll.java b/src/test/TestAll.java new file mode 100644 index 0000000..0900854 --- /dev/null +++ b/src/test/TestAll.java @@ -0,0 +1,22 @@ +package test; + +import input.Order; +import noteBook.NoteBook; + +import java.io.IOException; + +public class TestAll { + public static void main(String[] args) throws IOException { + NoteBook book = new NoteBook(); + book.fileReading("TestAll"); + for (input.Order iO: input.Order.values()) + for (input.Presentation p: input.Presentation.values()) + for (noteBook.Order nO: noteBook.Order.values()) + book.display(iO, p, nO); + book.select("Florian"); + for (input.Order iO: input.Order.values()) + for (input.Presentation p: input.Presentation.values()) + for (noteBook.Order nO: noteBook.Order.values()) + book.displaySelected(iO, p, nO); + } +}