32 lines
1.2 KiB
Java
32 lines
1.2 KiB
Java
package client;
|
|
|
|
import model.Article;
|
|
import model.Image;
|
|
import model.NewsCollection;
|
|
|
|
public class Client {
|
|
|
|
public static void main(String[] args) {
|
|
NewsCollection masterCollection = new NewsCollection("Daily news");
|
|
|
|
Article changedArticle = new Article("Harder, Better, Faster, Stronger. Doping controls loosened","ups");
|
|
|
|
masterCollection.addItem(new NewsCollection("Sports")
|
|
.addItem(changedArticle)
|
|
.addItem(new Image("Athletic cat contest", 800, 600, "zdf")))
|
|
.addItem(new NewsCollection("Local news")
|
|
.addItem(new Article("Missing Cat missed.", "mfg"))
|
|
.addItem(new Article("Corrupted local politician selling cats.", "ard"))
|
|
.addItem(new Image("Missing cat", 1280, 720, "anonymous")));
|
|
|
|
System.out.println("\n===List===\n");
|
|
System.out.print(masterCollection.getOverviewInformation());
|
|
System.out.println("\n===Contents===\n");
|
|
System.out.print(masterCollection.getDetailedInformation());
|
|
System.out.println("\n===After change===\n");
|
|
|
|
changedArticle.setTitle("Harder, Better, Faster, Stronger? Doping controls loosened");
|
|
masterCollection.addItem(new Image("A tasty cat", 640, 480, "alf"));
|
|
}
|
|
}
|